This repository was archived by the owner on Sep 14, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change 11import React from "react" ;
22import { Alert } from "react-bootstrap" ;
3+ import { TS_ESLINT_SCOPE } from "@/components/constants" ;
34import type { FC } from "react" ;
45import type { Linter } from "eslint" ;
56
7+ const DOCS_PATH =
8+ "https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/" ;
9+
610interface Props {
711 message : Linter . LintMessage ;
812}
@@ -12,7 +16,15 @@ export const Message: FC<Props> = ({ message }) => {
1216
1317 return (
1418 < Alert variant = { fatal ? "danger" : "primary" } >
15- { `${ line } :${ column } - ${ lintMsg } (${ ruleId } )` }
19+ { `${ line } :${ column } - ${ lintMsg } (` }
20+ < Alert . Link
21+ target = "_blank"
22+ rel = "noopener noreferrer"
23+ href = { `${ DOCS_PATH } ${ ruleId ?. replace ( `${ TS_ESLINT_SCOPE } /` , "" ) } .md` }
24+ >
25+ { ruleId }
26+ </ Alert . Link >
27+ { ")" }
1628 </ Alert >
1729 ) ;
1830} ;
Original file line number Diff line number Diff line change 11import type { Linter } from "eslint" ;
22
33export const EDITING_TIMEOUT = 300 ;
4-
4+ export const TS_ESLINT_SCOPE = "@typescript-eslint" ;
55export const DEFAULT_CODE = `
66async function invalidInTryCatch1() {
77 try {
You can’t perform that action at this time.
0 commit comments