Skip to content

Commit

Permalink
feat: support show rule ID for ESLint (resolve #132)
Browse files Browse the repository at this point in the history
  • Loading branch information
fi3ework committed Apr 6, 2022
1 parent db5e43c commit 5d9ef30
Show file tree
Hide file tree
Showing 9 changed files with 36 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Array [
"line": 3,
},
},
"message": "Unexpected var, use let or const instead.",
"message": "Unexpected var, use let or const instead. (no-var)",
"stripedCodeFrame": " 1 | import { text } from './text'
2 |
> 3 | var hello = 'Hello'
Expand Down Expand Up @@ -83,7 +83,7 @@ Array [
"line": 4,
},
},
"message": "Unexpected var, use let or const instead.",
"message": "Unexpected var, use let or const instead. (no-var)",
"stripedCodeFrame": " 2 |
3 | var hello = 'Hello'
> 4 | var hello1 = 'Hello1'
Expand Down
2 changes: 1 addition & 1 deletion packages/vite-plugin-checker/src/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ export function normalizeEslintDiagnostic(diagnostic: ESLint.LintResult): Normal
})

return {
message: d.message,
message: `${d.message} (${d.ruleId})`,
conclusion: '',
codeFrame,
stripedCodeFrame: codeFrame && strip(codeFrame),
Expand Down
6 changes: 3 additions & 3 deletions playground/basic/__tests__/__snapshots__/default.spec.ts.snap
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`config-default serve get initial error and subsequent error 1`] = `"[{\\"checkerId\\":\\"ESLint\\",\\"frame\\":\\" 1 | import { text } from './text'/n 2 |/n > 3 | var hello = 'Hello'/n | ^^^^^^^^^^^^^^^^^^^/n 4 |/n 5 | const rootDom = document.querySelector('#root')! as HTMLElement/n 6 | rootDom.innerHTML = hello + text\\",\\"id\\":\\"<PROJECT_ROOT>/temp/basic/src/main.ts\\",\\"level\\":1,\\"loc\\":{\\"column\\":1,\\"file\\":\\"<PROJECT_ROOT>/temp/basic/src/main.ts\\",\\"line\\":3},\\"message\\":\\"Unexpected var, use let or const instead.\\",\\"stack\\":\\"\\"},{\\"checkerId\\":\\"ESLint\\",\\"frame\\":\\" 3 | var hello = 'Hello'/n 4 |/n > 5 | const rootDom = document.querySelector('#root')! as HTMLElement/n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^/n 6 | rootDom.innerHTML = hello + text/n 7 |/n 8 | export {}\\",\\"id\\":\\"<PROJECT_ROOT>/temp/basic/src/main.ts\\",\\"level\\":0,\\"loc\\":{\\"column\\":17,\\"file\\":\\"<PROJECT_ROOT>/temp/basic/src/main.ts\\",\\"line\\":5},\\"message\\":\\"Forbidden non-null assertion.\\",\\"stack\\":\\"\\"}]"`;
exports[`config-default serve get initial error and subsequent error 1`] = `"[{\\"checkerId\\":\\"ESLint\\",\\"frame\\":\\" 1 | import { text } from './text'/n 2 |/n > 3 | var hello = 'Hello'/n | ^^^^^^^^^^^^^^^^^^^/n 4 |/n 5 | const rootDom = document.querySelector('#root')! as HTMLElement/n 6 | rootDom.innerHTML = hello + text\\",\\"id\\":\\"<PROJECT_ROOT>/temp/basic/src/main.ts\\",\\"level\\":1,\\"loc\\":{\\"column\\":1,\\"file\\":\\"<PROJECT_ROOT>/temp/basic/src/main.ts\\",\\"line\\":3},\\"message\\":\\"Unexpected var, use let or const instead. (no-var)\\",\\"stack\\":\\"\\"},{\\"checkerId\\":\\"ESLint\\",\\"frame\\":\\" 3 | var hello = 'Hello'/n 4 |/n > 5 | const rootDom = document.querySelector('#root')! as HTMLElement/n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^/n 6 | rootDom.innerHTML = hello + text/n 7 |/n 8 | export {}\\",\\"id\\":\\"<PROJECT_ROOT>/temp/basic/src/main.ts\\",\\"level\\":0,\\"loc\\":{\\"column\\":17,\\"file\\":\\"<PROJECT_ROOT>/temp/basic/src/main.ts\\",\\"line\\":5},\\"message\\":\\"Forbidden non-null assertion. (@typescript-eslint/no-non-null-assertion)\\",\\"stack\\":\\"\\"}]"`;

exports[`config-default serve get initial error and subsequent error 2`] = `
" ERROR(ESLint) Unexpected var, use let or const instead.
" ERROR(ESLint) Unexpected var, use let or const instead. (no-var)
FILE <PROJECT_ROOT>/temp/basic/src/main.ts:3:1
1 | import { text } from './text'
Expand All @@ -13,7 +13,7 @@ exports[`config-default serve get initial error and subsequent error 2`] = `
4 |
5 | const rootDom = document.querySelector('#root')! as HTMLElement
6 | rootDom.innerHTML = hello + text
WARNING(ESLint) Forbidden non-null assertion.
WARNING(ESLint) Forbidden non-null assertion. (@typescript-eslint/no-non-null-assertion)
FILE <PROJECT_ROOT>/temp/basic/src/main.ts:5:17
3 | var hello = 'Hello'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`overlay-terminal-false serve get initial error and subsequent error 1`] = `"[{\\"checkerId\\":\\"ESLint\\",\\"frame\\":\\" 1 | import { text } from './text'/n 2 |/n > 3 | var hello = 'Hello'/n | ^^^^^^^^^^^^^^^^^^^/n 4 |/n 5 | const rootDom = document.querySelector('#root')! as HTMLElement/n 6 | rootDom.innerHTML = hello + text\\",\\"id\\":\\"<PROJECT_ROOT>/temp/basic/src/main.ts\\",\\"level\\":1,\\"loc\\":{\\"column\\":1,\\"file\\":\\"<PROJECT_ROOT>/temp/basic/src/main.ts\\",\\"line\\":3},\\"message\\":\\"Unexpected var, use let or const instead.\\",\\"stack\\":\\"\\"},{\\"checkerId\\":\\"ESLint\\",\\"frame\\":\\" 3 | var hello = 'Hello'/n 4 |/n > 5 | const rootDom = document.querySelector('#root')! as HTMLElement/n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^/n 6 | rootDom.innerHTML = hello + text/n 7 |/n 8 | export {}\\",\\"id\\":\\"<PROJECT_ROOT>/temp/basic/src/main.ts\\",\\"level\\":0,\\"loc\\":{\\"column\\":17,\\"file\\":\\"<PROJECT_ROOT>/temp/basic/src/main.ts\\",\\"line\\":5},\\"message\\":\\"Forbidden non-null assertion.\\",\\"stack\\":\\"\\"}]"`;
exports[`overlay-terminal-false serve get initial error and subsequent error 1`] = `"[{\\"checkerId\\":\\"ESLint\\",\\"frame\\":\\" 1 | import { text } from './text'/n 2 |/n > 3 | var hello = 'Hello'/n | ^^^^^^^^^^^^^^^^^^^/n 4 |/n 5 | const rootDom = document.querySelector('#root')! as HTMLElement/n 6 | rootDom.innerHTML = hello + text\\",\\"id\\":\\"<PROJECT_ROOT>/temp/basic/src/main.ts\\",\\"level\\":1,\\"loc\\":{\\"column\\":1,\\"file\\":\\"<PROJECT_ROOT>/temp/basic/src/main.ts\\",\\"line\\":3},\\"message\\":\\"Unexpected var, use let or const instead. (no-var)\\",\\"stack\\":\\"\\"},{\\"checkerId\\":\\"ESLint\\",\\"frame\\":\\" 3 | var hello = 'Hello'/n 4 |/n > 5 | const rootDom = document.querySelector('#root')! as HTMLElement/n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^/n 6 | rootDom.innerHTML = hello + text/n 7 |/n 8 | export {}\\",\\"id\\":\\"<PROJECT_ROOT>/temp/basic/src/main.ts\\",\\"level\\":0,\\"loc\\":{\\"column\\":17,\\"file\\":\\"<PROJECT_ROOT>/temp/basic/src/main.ts\\",\\"line\\":5},\\"message\\":\\"Forbidden non-null assertion. (@typescript-eslint/no-non-null-assertion)\\",\\"stack\\":\\"\\"}]"`;

exports[`overlay-terminal-false serve get initial error and subsequent error 2`] = `""`;
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`overlay-true overlay prompts and changes 1`] = `"Unexpected var, use let or const instead."`;
exports[`overlay-true overlay prompts and changes 1`] = `"Unexpected var, use let or const instead. (no-var)"`;

exports[`overlay-true overlay prompts and changes 2`] = `"<PROJECT_ROOT>/temp/basic/src/main.ts:3:1"`;
Expand Down
8 changes: 4 additions & 4 deletions playground/eslint/__tests__/__snapshots__/config.spec.ts.snap
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`eslint-config serve get initial error and subsequent error 1`] = `"[{\\"checkerId\\":\\"ESLint\\",\\"frame\\":\\" 3 | var hello = 'Hello'/n 4 |/n > 5 | const rootDom = document.querySelector('#root')!/n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^/n 6 | rootDom.innerHTML = hello + text/n 7 |/n 8 | export {}\\",\\"id\\":\\"<PROJECT_ROOT>/temp/eslint/src/main.ts\\",\\"level\\":0,\\"loc\\":{\\"column\\":17,\\"file\\":\\"<PROJECT_ROOT>/temp/eslint/src/main.ts\\",\\"line\\":5},\\"message\\":\\"Forbidden non-null assertion.\\",\\"stack\\":\\"\\"}]"`;
exports[`eslint-config serve get initial error and subsequent error 1`] = `"[{\\"checkerId\\":\\"ESLint\\",\\"frame\\":\\" 3 | var hello = 'Hello'/n 4 |/n > 5 | const rootDom = document.querySelector('#root')!/n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^/n 6 | rootDom.innerHTML = hello + text/n 7 |/n 8 | export {}\\",\\"id\\":\\"<PROJECT_ROOT>/temp/eslint/src/main.ts\\",\\"level\\":0,\\"loc\\":{\\"column\\":17,\\"file\\":\\"<PROJECT_ROOT>/temp/eslint/src/main.ts\\",\\"line\\":5},\\"message\\":\\"Forbidden non-null assertion. (@typescript-eslint/no-non-null-assertion)\\",\\"stack\\":\\"\\"}]"`;

exports[`eslint-config serve get initial error and subsequent error 2`] = `
" WARNING(ESLint) Forbidden non-null assertion.
" WARNING(ESLint) Forbidden non-null assertion. (@typescript-eslint/no-non-null-assertion)
FILE <PROJECT_ROOT>/temp/eslint/src/main.ts:5:17
3 | var hello = 'Hello'
Expand All @@ -16,10 +16,10 @@ exports[`eslint-config serve get initial error and subsequent error 2`] = `
[ESLint] Found 0 error and 1 warning"
`;
exports[`eslint-config serve get initial error and subsequent error 3`] = `"[{\\"checkerId\\":\\"ESLint\\",\\"frame\\":\\" 3 | var hello = 'Hello~'/n 4 |/n > 5 | const rootDom = document.querySelector('#root')!/n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^/n 6 | rootDom.innerHTML = hello + text/n 7 |/n 8 | export {}\\",\\"id\\":\\"<PROJECT_ROOT>/temp/eslint/src/main.ts\\",\\"level\\":0,\\"loc\\":{\\"column\\":17,\\"file\\":\\"<PROJECT_ROOT>/temp/eslint/src/main.ts\\",\\"line\\":5},\\"message\\":\\"Forbidden non-null assertion.\\",\\"stack\\":\\"\\"}]"`;
exports[`eslint-config serve get initial error and subsequent error 3`] = `"[{\\"checkerId\\":\\"ESLint\\",\\"frame\\":\\" 3 | var hello = 'Hello~'/n 4 |/n > 5 | const rootDom = document.querySelector('#root')!/n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^/n 6 | rootDom.innerHTML = hello + text/n 7 |/n 8 | export {}\\",\\"id\\":\\"<PROJECT_ROOT>/temp/eslint/src/main.ts\\",\\"level\\":0,\\"loc\\":{\\"column\\":17,\\"file\\":\\"<PROJECT_ROOT>/temp/eslint/src/main.ts\\",\\"line\\":5},\\"message\\":\\"Forbidden non-null assertion. (@typescript-eslint/no-non-null-assertion)\\",\\"stack\\":\\"\\"}]"`;
exports[`eslint-config serve get initial error and subsequent error 4`] = `
" WARNING(ESLint) Forbidden non-null assertion.
" WARNING(ESLint) Forbidden non-null assertion. (@typescript-eslint/no-non-null-assertion)
FILE <PROJECT_ROOT>/temp/eslint/src/main.ts:5:17
3 | var hello = 'Hello~'
Expand Down
18 changes: 9 additions & 9 deletions playground/eslint/__tests__/__snapshots__/test.spec.ts.snap
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`eslint serve get initial error and subsequent error 1`] = `"[{\\"checkerId\\":\\"ESLint\\",\\"frame\\":\\" 1 | import { text } from './text'/n 2 |/n > 3 | var hello = 'Hello'/n | ^^^^^^^^^^^^^^^^^^^/n 4 |/n 5 | const rootDom = document.querySelector('#root')!/n 6 | rootDom.innerHTML = hello + text\\",\\"id\\":\\"<PROJECT_ROOT>/temp/eslint/src/main.ts\\",\\"level\\":1,\\"loc\\":{\\"column\\":1,\\"file\\":\\"<PROJECT_ROOT>/temp/eslint/src/main.ts\\",\\"line\\":3},\\"message\\":\\"Unexpected var, use let or const instead.\\",\\"stack\\":\\"\\"},{\\"checkerId\\":\\"ESLint\\",\\"frame\\":\\" 3 | var hello = 'Hello'/n 4 |/n > 5 | const rootDom = document.querySelector('#root')!/n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^/n 6 | rootDom.innerHTML = hello + text/n 7 |/n 8 | export {}\\",\\"id\\":\\"<PROJECT_ROOT>/temp/eslint/src/main.ts\\",\\"level\\":0,\\"loc\\":{\\"column\\":17,\\"file\\":\\"<PROJECT_ROOT>/temp/eslint/src/main.ts\\",\\"line\\":5},\\"message\\":\\"Forbidden non-null assertion.\\",\\"stack\\":\\"\\"}]"`;
exports[`eslint serve get initial error and subsequent error 1`] = `"[{\\"checkerId\\":\\"ESLint\\",\\"frame\\":\\" 1 | import { text } from './text'/n 2 |/n > 3 | var hello = 'Hello'/n | ^^^^^^^^^^^^^^^^^^^/n 4 |/n 5 | const rootDom = document.querySelector('#root')!/n 6 | rootDom.innerHTML = hello + text\\",\\"id\\":\\"<PROJECT_ROOT>/temp/eslint/src/main.ts\\",\\"level\\":1,\\"loc\\":{\\"column\\":1,\\"file\\":\\"<PROJECT_ROOT>/temp/eslint/src/main.ts\\",\\"line\\":3},\\"message\\":\\"Unexpected var, use let or const instead. (no-var)\\",\\"stack\\":\\"\\"},{\\"checkerId\\":\\"ESLint\\",\\"frame\\":\\" 3 | var hello = 'Hello'/n 4 |/n > 5 | const rootDom = document.querySelector('#root')!/n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^/n 6 | rootDom.innerHTML = hello + text/n 7 |/n 8 | export {}\\",\\"id\\":\\"<PROJECT_ROOT>/temp/eslint/src/main.ts\\",\\"level\\":0,\\"loc\\":{\\"column\\":17,\\"file\\":\\"<PROJECT_ROOT>/temp/eslint/src/main.ts\\",\\"line\\":5},\\"message\\":\\"Forbidden non-null assertion. (@typescript-eslint/no-non-null-assertion)\\",\\"stack\\":\\"\\"}]"`;

exports[`eslint serve get initial error and subsequent error 2`] = `
" ERROR(ESLint) Unexpected var, use let or const instead.
" ERROR(ESLint) Unexpected var, use let or const instead. (no-var)
FILE <PROJECT_ROOT>/temp/eslint/src/main.ts:3:1
1 | import { text } from './text'
Expand All @@ -13,7 +13,7 @@ exports[`eslint serve get initial error and subsequent error 2`] = `
4 |
5 | const rootDom = document.querySelector('#root')!
6 | rootDom.innerHTML = hello + text
WARNING(ESLint) Forbidden non-null assertion.
WARNING(ESLint) Forbidden non-null assertion. (@typescript-eslint/no-non-null-assertion)
FILE <PROJECT_ROOT>/temp/eslint/src/main.ts:5:17
3 | var hello = 'Hello'
Expand All @@ -26,10 +26,10 @@ exports[`eslint serve get initial error and subsequent error 2`] = `
[ESLint] Found 1 error and 1 warning"
`;
exports[`eslint serve get initial error and subsequent error 3`] = `"[{\\"checkerId\\":\\"ESLint\\",\\"frame\\":\\" 1 | import { text } from './text'/n 2 |/n > 3 | var hello = 'Hello~'/n | ^^^^^^^^^^^^^^^^^^^^/n 4 |/n 5 | const rootDom = document.querySelector('#root')!/n 6 | rootDom.innerHTML = hello + text\\",\\"id\\":\\"<PROJECT_ROOT>/temp/eslint/src/main.ts\\",\\"level\\":1,\\"loc\\":{\\"column\\":1,\\"file\\":\\"<PROJECT_ROOT>/temp/eslint/src/main.ts\\",\\"line\\":3},\\"message\\":\\"Unexpected var, use let or const instead.\\",\\"stack\\":\\"\\"},{\\"checkerId\\":\\"ESLint\\",\\"frame\\":\\" 3 | var hello = 'Hello~'/n 4 |/n > 5 | const rootDom = document.querySelector('#root')!/n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^/n 6 | rootDom.innerHTML = hello + text/n 7 |/n 8 | export {}\\",\\"id\\":\\"<PROJECT_ROOT>/temp/eslint/src/main.ts\\",\\"level\\":0,\\"loc\\":{\\"column\\":17,\\"file\\":\\"<PROJECT_ROOT>/temp/eslint/src/main.ts\\",\\"line\\":5},\\"message\\":\\"Forbidden non-null assertion.\\",\\"stack\\":\\"\\"}]"`;
exports[`eslint serve get initial error and subsequent error 3`] = `"[{\\"checkerId\\":\\"ESLint\\",\\"frame\\":\\" 1 | import { text } from './text'/n 2 |/n > 3 | var hello = 'Hello~'/n | ^^^^^^^^^^^^^^^^^^^^/n 4 |/n 5 | const rootDom = document.querySelector('#root')!/n 6 | rootDom.innerHTML = hello + text\\",\\"id\\":\\"<PROJECT_ROOT>/temp/eslint/src/main.ts\\",\\"level\\":1,\\"loc\\":{\\"column\\":1,\\"file\\":\\"<PROJECT_ROOT>/temp/eslint/src/main.ts\\",\\"line\\":3},\\"message\\":\\"Unexpected var, use let or const instead. (no-var)\\",\\"stack\\":\\"\\"},{\\"checkerId\\":\\"ESLint\\",\\"frame\\":\\" 3 | var hello = 'Hello~'/n 4 |/n > 5 | const rootDom = document.querySelector('#root')!/n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^/n 6 | rootDom.innerHTML = hello + text/n 7 |/n 8 | export {}\\",\\"id\\":\\"<PROJECT_ROOT>/temp/eslint/src/main.ts\\",\\"level\\":0,\\"loc\\":{\\"column\\":17,\\"file\\":\\"<PROJECT_ROOT>/temp/eslint/src/main.ts\\",\\"line\\":5},\\"message\\":\\"Forbidden non-null assertion. (@typescript-eslint/no-non-null-assertion)\\",\\"stack\\":\\"\\"}]"`;
exports[`eslint serve get initial error and subsequent error 4`] = `
" ERROR(ESLint) Unexpected var, use let or const instead.
" ERROR(ESLint) Unexpected var, use let or const instead. (no-var)
FILE <PROJECT_ROOT>/temp/eslint/src/main.ts:3:1
1 | import { text } from './text'
Expand All @@ -39,7 +39,7 @@ exports[`eslint serve get initial error and subsequent error 4`] = `
4 |
5 | const rootDom = document.querySelector('#root')!
6 | rootDom.innerHTML = hello + text
WARNING(ESLint) Forbidden non-null assertion.
WARNING(ESLint) Forbidden non-null assertion. (@typescript-eslint/no-non-null-assertion)
FILE <PROJECT_ROOT>/temp/eslint/src/main.ts:5:17
3 | var hello = 'Hello~'
Expand All @@ -52,10 +52,10 @@ exports[`eslint serve get initial error and subsequent error 4`] = `
[ESLint] Found 1 error and 1 warning"
`;
exports[`eslint serve get initial error and subsequent error 5`] = `"[{\\"checkerId\\":\\"ESLint\\",\\"frame\\":\\" 1 | import { text } from './text'/n 2 |/n > 3 | var hello = 'Hello~'/n | ^^^^^^^^^^^^^^^^^^^^/n 4 |/n 5 | const rootDom = document.querySelector('#root')!/n 6 | rootDom.innerHTML = hello + text\\",\\"id\\":\\"<PROJECT_ROOT>/temp/eslint/src/main.ts\\",\\"level\\":1,\\"loc\\":{\\"column\\":1,\\"file\\":\\"<PROJECT_ROOT>/temp/eslint/src/main.ts\\",\\"line\\":3},\\"message\\":\\"Unexpected var, use let or const instead.\\",\\"stack\\":\\"\\"},{\\"checkerId\\":\\"ESLint\\",\\"frame\\":\\" 3 | var hello = 'Hello~'/n 4 |/n > 5 | const rootDom = document.querySelector('#root')!/n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^/n 6 | rootDom.innerHTML = hello + text/n 7 |/n 8 | export {}\\",\\"id\\":\\"<PROJECT_ROOT>/temp/eslint/src/main.ts\\",\\"level\\":0,\\"loc\\":{\\"column\\":17,\\"file\\":\\"<PROJECT_ROOT>/temp/eslint/src/main.ts\\",\\"line\\":5},\\"message\\":\\"Forbidden non-null assertion.\\",\\"stack\\":\\"\\"}]"`;
exports[`eslint serve get initial error and subsequent error 5`] = `"[{\\"checkerId\\":\\"ESLint\\",\\"frame\\":\\" 1 | import { text } from './text'/n 2 |/n > 3 | var hello = 'Hello~'/n | ^^^^^^^^^^^^^^^^^^^^/n 4 |/n 5 | const rootDom = document.querySelector('#root')!/n 6 | rootDom.innerHTML = hello + text\\",\\"id\\":\\"<PROJECT_ROOT>/temp/eslint/src/main.ts\\",\\"level\\":1,\\"loc\\":{\\"column\\":1,\\"file\\":\\"<PROJECT_ROOT>/temp/eslint/src/main.ts\\",\\"line\\":3},\\"message\\":\\"Unexpected var, use let or const instead. (no-var)\\",\\"stack\\":\\"\\"},{\\"checkerId\\":\\"ESLint\\",\\"frame\\":\\" 3 | var hello = 'Hello~'/n 4 |/n > 5 | const rootDom = document.querySelector('#root')!/n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^/n 6 | rootDom.innerHTML = hello + text/n 7 |/n 8 | export {}\\",\\"id\\":\\"<PROJECT_ROOT>/temp/eslint/src/main.ts\\",\\"level\\":0,\\"loc\\":{\\"column\\":17,\\"file\\":\\"<PROJECT_ROOT>/temp/eslint/src/main.ts\\",\\"line\\":5},\\"message\\":\\"Forbidden non-null assertion. (@typescript-eslint/no-non-null-assertion)\\",\\"stack\\":\\"\\"}]"`;
exports[`eslint serve get initial error and subsequent error 6`] = `
" ERROR(ESLint) Unexpected var, use let or const instead.
" ERROR(ESLint) Unexpected var, use let or const instead. (no-var)
FILE <PROJECT_ROOT>/temp/eslint/src/main.ts:3:1
1 | import { text } from './text'
Expand All @@ -65,7 +65,7 @@ exports[`eslint serve get initial error and subsequent error 6`] = `
4 |
5 | const rootDom = document.querySelector('#root')!
6 | rootDom.innerHTML = hello + text
WARNING(ESLint) Forbidden non-null assertion.
WARNING(ESLint) Forbidden non-null assertion. (@typescript-eslint/no-non-null-assertion)
FILE <PROJECT_ROOT>/temp/eslint/src/main.ts:5:17
3 | var hello = 'Hello~'
Expand Down
Loading

0 comments on commit 5d9ef30

Please sign in to comment.