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 1
1
import React from "react" ;
2
2
import { Alert } from "react-bootstrap" ;
3
+ import { TS_ESLINT_SCOPE } from "@/components/constants" ;
3
4
import type { FC } from "react" ;
4
5
import type { Linter } from "eslint" ;
5
6
7
+ const DOCS_PATH =
8
+ "https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/" ;
9
+
6
10
interface Props {
7
11
message : Linter . LintMessage ;
8
12
}
@@ -12,7 +16,15 @@ export const Message: FC<Props> = ({ message }) => {
12
16
13
17
return (
14
18
< 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
+ { ")" }
16
28
</ Alert >
17
29
) ;
18
30
} ;
Original file line number Diff line number Diff line change 1
1
import type { Linter } from "eslint" ;
2
2
3
3
export const EDITING_TIMEOUT = 300 ;
4
-
4
+ export const TS_ESLINT_SCOPE = "@typescript-eslint" ;
5
5
export const DEFAULT_CODE = `
6
6
async function invalidInTryCatch1() {
7
7
try {
You can’t perform that action at this time.
0 commit comments