diff --git a/playground/backend-integration/__test__/__snapshots__/test.spec.ts.snap b/playground/backend-integration/__test__/__snapshots__/test.spec.ts.snap index 84d6b23f..a176e90f 100644 --- a/playground/backend-integration/__test__/__snapshots__/test.spec.ts.snap +++ b/playground/backend-integration/__test__/__snapshots__/test.spec.ts.snap @@ -3,7 +3,8 @@ exports[`backend-integration > serve > get initial error 1`] = `"[{"checkerId":"TypeScript","frame":" 4 |/n 5 | function App() {/n > 6 | const [count, setCount] = useState(0)/n | ^/n 7 |/n 8 | return (/n 9 |
","id":"/playground-temp/backend-integration/src/App.tsx","level":1,"loc":{"column":46,"file":"/playground-temp/backend-integration/src/App.tsx","line":6},"message":"Argument of type 'number' is not assignable to parameter of type 'string | (() => string)'.","stack":""}]"`; exports[`backend-integration > serve > get initial error 2`] = ` -" +[ + " ERROR(TypeScript) Argument of type 'number' is not assignable to parameter of type 'string | (() => string)'. FILE /playground-temp/backend-integration/src/App.tsx:6:46 @@ -15,5 +16,6 @@ exports[`backend-integration > serve > get initial error 2`] = ` 8 | return ( 9 |
-[TypeScript] Found 1 error. Watching for file changes." +[TypeScript] Found 1 error. Watching for file changes.", +] `; diff --git a/playground/config-default/__tests__/__snapshots__/test.spec.ts.snap b/playground/config-default/__tests__/__snapshots__/test.spec.ts.snap index 47cd486b..f3305f94 100644 --- a/playground/config-default/__tests__/__snapshots__/test.spec.ts.snap +++ b/playground/config-default/__tests__/__snapshots__/test.spec.ts.snap @@ -3,7 +3,8 @@ exports[`config-default > serve > get initial 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":"/playground-temp/config-default/src/main.ts","level":1,"loc":{"column":1,"file":"/playground-temp/config-default/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":"/playground-temp/config-default/src/main.ts","level":0,"loc":{"column":17,"file":"/playground-temp/config-default/src/main.ts","line":5},"message":"Forbidden non-null assertion. (@typescript-eslint/no-non-null-assertion)","stack":""}]"`; exports[`config-default > serve > get initial error 2`] = ` -" ERROR(ESLint) Unexpected var, use let or const instead. (no-var) +[ + " ERROR(ESLint) Unexpected var, use let or const instead. (no-var) FILE /playground-temp/config-default/src/main.ts:3:1 1 | import { text } from './text' @@ -13,7 +14,8 @@ exports[`config-default > serve > get initial error 2`] = ` 4 | 5 | const rootDom = document.querySelector('#root')! as HTMLElement 6 | rootDom.innerHTML = hello + text - WARNING(ESLint) Forbidden non-null assertion. (@typescript-eslint/no-non-null-assertion) +", + " WARNING(ESLint) Forbidden non-null assertion. (@typescript-eslint/no-non-null-assertion) FILE /playground-temp/config-default/src/main.ts:5:17 3 | var hello = 'Hello' @@ -23,5 +25,7 @@ exports[`config-default > serve > get initial error 2`] = ` 6 | rootDom.innerHTML = hello + text 7 | 8 | export {} -[ESLint] Found 1 error and 1 warning" +", + "[ESLint] Found 1 error and 1 warning", +] `; diff --git a/playground/config-terminal-false/__tests__/__snapshots__/test.spec.ts.snap b/playground/config-terminal-false/__tests__/__snapshots__/test.spec.ts.snap index 33ffb686..3d623864 100644 --- a/playground/config-terminal-false/__tests__/__snapshots__/test.spec.ts.snap +++ b/playground/config-terminal-false/__tests__/__snapshots__/test.spec.ts.snap @@ -2,4 +2,4 @@ exports[`config-terminal-false > serve > should not log into terminal 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":"/playground-temp/config-terminal-false/src/main.ts","level":1,"loc":{"column":1,"file":"/playground-temp/config-terminal-false/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":"/playground-temp/config-terminal-false/src/main.ts","level":0,"loc":{"column":17,"file":"/playground-temp/config-terminal-false/src/main.ts","line":5},"message":"Forbidden non-null assertion. (@typescript-eslint/no-non-null-assertion)","stack":""}]"`; -exports[`config-terminal-false > serve > should not log into terminal 2`] = `""`; +exports[`config-terminal-false > serve > should not log into terminal 2`] = `[]`; diff --git a/playground/eslint-config-log-level/__tests__/__snapshots__/test.spec.ts.snap b/playground/eslint-config-log-level/__tests__/__snapshots__/test.spec.ts.snap index d0dafd92..398f7ec9 100644 --- a/playground/eslint-config-log-level/__tests__/__snapshots__/test.spec.ts.snap +++ b/playground/eslint-config-log-level/__tests__/__snapshots__/test.spec.ts.snap @@ -3,7 +3,8 @@ exports[`eslint-config-log-level > serve > should only emit warning logs 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":"/playground-temp/eslint-config-log-level/src/main.ts","level":0,"loc":{"column":17,"file":"/playground-temp/eslint-config-log-level/src/main.ts","line":5},"message":"Forbidden non-null assertion. (@typescript-eslint/no-non-null-assertion)","stack":""}]"`; exports[`eslint-config-log-level > serve > should only emit warning logs 2`] = ` -" WARNING(ESLint) Forbidden non-null assertion. (@typescript-eslint/no-non-null-assertion) +[ + " WARNING(ESLint) Forbidden non-null assertion. (@typescript-eslint/no-non-null-assertion) FILE /playground-temp/eslint-config-log-level/src/main.ts:5:17 3 | var hello = 'Hello' @@ -13,13 +14,16 @@ exports[`eslint-config-log-level > serve > should only emit warning logs 2`] = ` 6 | rootDom.innerHTML = hello + text 7 | 8 | export {} -[ESLint] Found 0 error and 1 warning" +", + "[ESLint] Found 0 error and 1 warning", +] `; exports[`eslint-config-log-level > serve > should only emit warning logs 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":"/playground-temp/eslint-config-log-level/src/main.ts","level":0,"loc":{"column":17,"file":"/playground-temp/eslint-config-log-level/src/main.ts","line":5},"message":"Forbidden non-null assertion. (@typescript-eslint/no-non-null-assertion)","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":"/playground-temp/eslint-config-log-level/src/main.ts","level":0,"loc":{"column":17,"file":"/playground-temp/eslint-config-log-level/src/main.ts","line":5},"message":"Forbidden non-null assertion. (@typescript-eslint/no-non-null-assertion)","stack":""}]"`; exports[`eslint-config-log-level > serve > should only emit warning logs 4`] = ` -" WARNING(ESLint) Forbidden non-null assertion. (@typescript-eslint/no-non-null-assertion) +[ + " WARNING(ESLint) Forbidden non-null assertion. (@typescript-eslint/no-non-null-assertion) FILE /playground-temp/eslint-config-log-level/src/main.ts:5:17 3 | var hello = 'Hello~' @@ -29,5 +33,7 @@ exports[`eslint-config-log-level > serve > should only emit warning logs 4`] = ` 6 | rootDom.innerHTML = hello + text 7 | 8 | export {} -[ESLint] Found 0 error and 1 warning" +", + "[ESLint] Found 0 error and 1 warning", +] `; diff --git a/playground/eslint-default/__tests__/__snapshots__/test.spec.ts.snap b/playground/eslint-default/__tests__/__snapshots__/test.spec.ts.snap index 84c2b2c5..2564a80e 100644 --- a/playground/eslint-default/__tests__/__snapshots__/test.spec.ts.snap +++ b/playground/eslint-default/__tests__/__snapshots__/test.spec.ts.snap @@ -1,9 +1,10 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html -exports[`eslint-default > serve > get initial error and subsequent error 1`] = `"[{"checkerId":"ESLint","frame":" 1 | import { text } from './text'/n 2 |/n > 3 | let count: string = 0/n | ^^^^^^^^^^^^^/n 4 | var hello = 'Hello'/n 5 |/n 6 | const rootDom = document.querySelector('#root')!","id":"/playground-temp/eslint-default/src/main.ts","level":0,"loc":{"column":5,"file":"/playground-temp/eslint-default/src/main.ts","line":3},"message":"'count' is assigned a value but never used. (@typescript-eslint/no-unused-vars)","stack":""},{"checkerId":"ESLint","frame":" 1 | import { text } from './text'/n 2 |/n > 3 | let count: string = 0/n | ^^^^^^^^^^^^^/n 4 | var hello = 'Hello'/n 5 |/n 6 | const rootDom = document.querySelector('#root')!","id":"/playground-temp/eslint-default/src/main.ts","level":1,"loc":{"column":5,"file":"/playground-temp/eslint-default/src/main.ts","line":3},"message":"'count' is never reassigned. Use 'const' instead. (prefer-const)","stack":""},{"checkerId":"ESLint","frame":" 2 |/n 3 | let count: string = 0/n > 4 | var hello = 'Hello'/n | ^^^^^^^^^^^^^^^^^^^/n 5 |/n 6 | const rootDom = document.querySelector('#root')!/n 7 | rootDom.innerHTML = hello + text","id":"/playground-temp/eslint-default/src/main.ts","level":1,"loc":{"column":1,"file":"/playground-temp/eslint-default/src/main.ts","line":4},"message":"Unexpected var, use let or const instead. (no-var)","stack":""},{"checkerId":"ESLint","frame":" 4 | var hello = 'Hello'/n 5 |/n > 6 | const rootDom = document.querySelector('#root')!/n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^/n 7 | rootDom.innerHTML = hello + text/n 8 |/n 9 | export {}","id":"/playground-temp/eslint-default/src/main.ts","level":0,"loc":{"column":17,"file":"/playground-temp/eslint-default/src/main.ts","line":6},"message":"Forbidden non-null assertion. (@typescript-eslint/no-non-null-assertion)","stack":""},{"checkerId":"TypeScript","frame":" 1 | import { text } from './text'/n 2 |/n > 3 | let count: string = 0/n | ^^^^^/n 4 | var hello = 'Hello'/n 5 |/n 6 | const rootDom = document.querySelector('#root')!","id":"/playground-temp/eslint-default/src/main.ts","level":1,"loc":{"column":5,"file":"/playground-temp/eslint-default/src/main.ts","line":3},"message":"Type 'number' is not assignable to type 'string'.","stack":""}]"`; +exports[`eslint-default > serve > get initial error and subsequent error 1`] = `"[{"checkerId":"ESLint","frame":" 1 | import { text } from './text'/n 2 |/n > 3 | let count: string = 0/n | ^^^^^^^^^^^^^/n 4 | var hello = 'Hello'/n 5 |/n 6 | const rootDom = document.querySelector('#root')!","id":"/playground-temp/eslint-default/src/main.ts","level":0,"loc":{"column":5,"file":"/playground-temp/eslint-default/src/main.ts","line":3},"message":"'count' is assigned a value but never used. (@typescript-eslint/no-unused-vars)","stack":""},{"checkerId":"ESLint","frame":" 1 | import { text } from './text'/n 2 |/n > 3 | let count: string = 0/n | ^^^^^^^^^^^^^/n 4 | var hello = 'Hello'/n 5 |/n 6 | const rootDom = document.querySelector('#root')!","id":"/playground-temp/eslint-default/src/main.ts","level":1,"loc":{"column":5,"file":"/playground-temp/eslint-default/src/main.ts","line":3},"message":"'count' is never reassigned. Use 'const' instead. (prefer-const)","stack":""},{"checkerId":"ESLint","frame":" 2 |/n 3 | let count: string = 0/n > 4 | var hello = 'Hello'/n | ^^^^^^^^^^^^^^^^^^^/n 5 |/n 6 | const rootDom = document.querySelector('#root')!/n 7 | rootDom.innerHTML = hello + text","id":"/playground-temp/eslint-default/src/main.ts","level":1,"loc":{"column":1,"file":"/playground-temp/eslint-default/src/main.ts","line":4},"message":"Unexpected var, use let or const instead. (no-var)","stack":""},{"checkerId":"ESLint","frame":" 4 | var hello = 'Hello'/n 5 |/n > 6 | const rootDom = document.querySelector('#root')!/n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^/n 7 | rootDom.innerHTML = hello + text/n 8 |/n 9 | export {}","id":"/playground-temp/eslint-default/src/main.ts","level":0,"loc":{"column":17,"file":"/playground-temp/eslint-default/src/main.ts","line":6},"message":"Forbidden non-null assertion. (@typescript-eslint/no-non-null-assertion)","stack":""}]"`; exports[`eslint-default > serve > get initial error and subsequent error 2`] = ` -" WARNING(ESLint) 'count' is assigned a value but never used. (@typescript-eslint/no-unused-vars) +[ + " WARNING(ESLint) 'count' is assigned a value but never used. (@typescript-eslint/no-unused-vars) FILE /playground-temp/eslint-default/src/main.ts:3:5 1 | import { text } from './text' @@ -13,7 +14,8 @@ exports[`eslint-default > serve > get initial error and subsequent error 2`] = ` 4 | var hello = 'Hello' 5 | 6 | const rootDom = document.querySelector('#root')! - ERROR(ESLint) 'count' is never reassigned. Use 'const' instead. (prefer-const) +", + " ERROR(ESLint) 'count' is never reassigned. Use 'const' instead. (prefer-const) FILE /playground-temp/eslint-default/src/main.ts:3:5 1 | import { text } from './text' @@ -23,7 +25,8 @@ exports[`eslint-default > serve > get initial error and subsequent error 2`] = ` 4 | var hello = 'Hello' 5 | 6 | const rootDom = document.querySelector('#root')! - ERROR(ESLint) Unexpected var, use let or const instead. (no-var) +", + " ERROR(ESLint) Unexpected var, use let or const instead. (no-var) FILE /playground-temp/eslint-default/src/main.ts:4:1 2 | @@ -33,7 +36,8 @@ exports[`eslint-default > serve > get initial error and subsequent error 2`] = ` 5 | 6 | const rootDom = document.querySelector('#root')! 7 | rootDom.innerHTML = hello + text - WARNING(ESLint) Forbidden non-null assertion. (@typescript-eslint/no-non-null-assertion) +", + " WARNING(ESLint) Forbidden non-null assertion. (@typescript-eslint/no-non-null-assertion) FILE /playground-temp/eslint-default/src/main.ts:6:17 4 | var hello = 'Hello' @@ -43,25 +47,16 @@ exports[`eslint-default > serve > get initial error and subsequent error 2`] = ` 7 | rootDom.innerHTML = hello + text 8 | 9 | export {} -[ESLint] Found 2 errors and 2 warnings - ERROR(TypeScript) Type 'number' is not assignable to type 'string'. - FILE /playground-temp/eslint-default/src/main.ts:3:5 - - 1 | import { text } from './text' - 2 | - > 3 | let count: string = 0 - | ^^^^^ - 4 | var hello = 'Hello' - 5 | - 6 | const rootDom = document.querySelector('#root')! - -[TypeScript] Found 1 error. Watching for file changes." +", + "[ESLint] Found 2 errors and 2 warnings", +] `; -exports[`eslint-default > serve > get initial error and subsequent error 3`] = `"[{"checkerId":"ESLint","frame":" 1 | import { text } from './text'/n 2 |/n > 3 | let count: string = 0/n | ^^^^^^^^^^^^^/n 4 | var hello = 'Hello'/n 5 |/n 6 | const rootDom = document.querySelector('#root')!","id":"/playground-temp/eslint-default/src/main.ts","level":0,"loc":{"column":5,"file":"/playground-temp/eslint-default/src/main.ts","line":3},"message":"'count' is assigned a value but never used. (@typescript-eslint/no-unused-vars)","stack":""},{"checkerId":"ESLint","frame":" 1 | import { text } from './text'/n 2 |/n > 3 | let count: string = 0/n | ^^^^^^^^^^^^^/n 4 | var hello = 'Hello'/n 5 |/n 6 | const rootDom = document.querySelector('#root')!","id":"/playground-temp/eslint-default/src/main.ts","level":1,"loc":{"column":5,"file":"/playground-temp/eslint-default/src/main.ts","line":3},"message":"'count' is never reassigned. Use 'const' instead. (prefer-const)","stack":""},{"checkerId":"ESLint","frame":" 2 |/n 3 | let count: string = 0/n > 4 | var hello = 'Hello'/n | ^^^^^^^^^^^^^^^^^^^/n 5 |/n 6 | const rootDom = document.querySelector('#root')!/n 7 | rootDom.innerHTML = hello + text","id":"/playground-temp/eslint-default/src/main.ts","level":1,"loc":{"column":1,"file":"/playground-temp/eslint-default/src/main.ts","line":4},"message":"Unexpected var, use let or const instead. (no-var)","stack":""},{"checkerId":"ESLint","frame":" 4 | var hello = 'Hello'/n 5 |/n > 6 | const rootDom = document.querySelector('#root')!/n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^/n 7 | rootDom.innerHTML = hello + text/n 8 |/n 9 | export {}","id":"/playground-temp/eslint-default/src/main.ts","level":0,"loc":{"column":17,"file":"/playground-temp/eslint-default/src/main.ts","line":6},"message":"Forbidden non-null assertion. (@typescript-eslint/no-non-null-assertion)","stack":""},{"checkerId":"TypeScript","frame":" 1 | import { text } from './text'/n 2 |/n > 3 | let count: string = 0/n | ^^^^^/n 4 | var hello = 'Hello'/n 5 |/n 6 | const rootDom = document.querySelector('#root')!","id":"/playground-temp/eslint-default/src/main.ts","level":1,"loc":{"column":5,"file":"/playground-temp/eslint-default/src/main.ts","line":3},"message":"Type 'number' is not assignable to type 'string'.","stack":""},{"checkerId":"ESLint","frame":" 1 | import { text } from './text'/n 2 |/n > 3 | let count: string = 0/n | ^^^^^^^^^^^^^/n 4 | var hello = 'Hello~'/n 5 |/n 6 | const rootDom = document.querySelector('#root')!","id":"/playground-temp/eslint-default/src/main.ts","level":0,"loc":{"column":5,"file":"/playground-temp/eslint-default/src/main.ts","line":3},"message":"'count' is assigned a value but never used. (@typescript-eslint/no-unused-vars)","stack":""},{"checkerId":"ESLint","frame":" 1 | import { text } from './text'/n 2 |/n > 3 | let count: string = 0/n | ^^^^^^^^^^^^^/n 4 | var hello = 'Hello~'/n 5 |/n 6 | const rootDom = document.querySelector('#root')!","id":"/playground-temp/eslint-default/src/main.ts","level":1,"loc":{"column":5,"file":"/playground-temp/eslint-default/src/main.ts","line":3},"message":"'count' is never reassigned. Use 'const' instead. (prefer-const)","stack":""},{"checkerId":"ESLint","frame":" 2 |/n 3 | let count: string = 0/n > 4 | var hello = 'Hello~'/n | ^^^^^^^^^^^^^^^^^^^^/n 5 |/n 6 | const rootDom = document.querySelector('#root')!/n 7 | rootDom.innerHTML = hello + text","id":"/playground-temp/eslint-default/src/main.ts","level":1,"loc":{"column":1,"file":"/playground-temp/eslint-default/src/main.ts","line":4},"message":"Unexpected var, use let or const instead. (no-var)","stack":""},{"checkerId":"ESLint","frame":" 4 | var hello = 'Hello~'/n 5 |/n > 6 | const rootDom = document.querySelector('#root')!/n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^/n 7 | rootDom.innerHTML = hello + text/n 8 |/n 9 | export {}","id":"/playground-temp/eslint-default/src/main.ts","level":0,"loc":{"column":17,"file":"/playground-temp/eslint-default/src/main.ts","line":6},"message":"Forbidden non-null assertion. (@typescript-eslint/no-non-null-assertion)","stack":""},{"checkerId":"TypeScript","frame":" 1 | import { text } from './text'/n 2 |/n > 3 | let count: string = 0/n | ^^^^^/n 4 | var hello = 'Hello~'/n 5 |/n 6 | const rootDom = document.querySelector('#root')!","id":"/playground-temp/eslint-default/src/main.ts","level":1,"loc":{"column":5,"file":"/playground-temp/eslint-default/src/main.ts","line":3},"message":"Type 'number' is not assignable to type 'string'.","stack":""}]"`; +exports[`eslint-default > serve > get initial error and subsequent error 3`] = `"[{"checkerId":"ESLint","frame":" 1 | import { text } from './text'/n 2 |/n > 3 | let count: string = 0/n | ^^^^^^^^^^^^^/n 4 | var hello = 'Hello'/n 5 |/n 6 | const rootDom = document.querySelector('#root')!","id":"/playground-temp/eslint-default/src/main.ts","level":0,"loc":{"column":5,"file":"/playground-temp/eslint-default/src/main.ts","line":3},"message":"'count' is assigned a value but never used. (@typescript-eslint/no-unused-vars)","stack":""},{"checkerId":"ESLint","frame":" 1 | import { text } from './text'/n 2 |/n > 3 | let count: string = 0/n | ^^^^^^^^^^^^^/n 4 | var hello = 'Hello'/n 5 |/n 6 | const rootDom = document.querySelector('#root')!","id":"/playground-temp/eslint-default/src/main.ts","level":1,"loc":{"column":5,"file":"/playground-temp/eslint-default/src/main.ts","line":3},"message":"'count' is never reassigned. Use 'const' instead. (prefer-const)","stack":""},{"checkerId":"ESLint","frame":" 2 |/n 3 | let count: string = 0/n > 4 | var hello = 'Hello'/n | ^^^^^^^^^^^^^^^^^^^/n 5 |/n 6 | const rootDom = document.querySelector('#root')!/n 7 | rootDom.innerHTML = hello + text","id":"/playground-temp/eslint-default/src/main.ts","level":1,"loc":{"column":1,"file":"/playground-temp/eslint-default/src/main.ts","line":4},"message":"Unexpected var, use let or const instead. (no-var)","stack":""},{"checkerId":"ESLint","frame":" 4 | var hello = 'Hello'/n 5 |/n > 6 | const rootDom = document.querySelector('#root')!/n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^/n 7 | rootDom.innerHTML = hello + text/n 8 |/n 9 | export {}","id":"/playground-temp/eslint-default/src/main.ts","level":0,"loc":{"column":17,"file":"/playground-temp/eslint-default/src/main.ts","line":6},"message":"Forbidden non-null assertion. (@typescript-eslint/no-non-null-assertion)","stack":""},{"checkerId":"ESLint","frame":" 1 | import { text } from './text'/n 2 |/n > 3 | let count: string = 0/n | ^^^^^^^^^^^^^/n 4 | var hello = 'Hello~'/n 5 |/n 6 | const rootDom = document.querySelector('#root')!","id":"/playground-temp/eslint-default/src/main.ts","level":0,"loc":{"column":5,"file":"/playground-temp/eslint-default/src/main.ts","line":3},"message":"'count' is assigned a value but never used. (@typescript-eslint/no-unused-vars)","stack":""},{"checkerId":"ESLint","frame":" 1 | import { text } from './text'/n 2 |/n > 3 | let count: string = 0/n | ^^^^^^^^^^^^^/n 4 | var hello = 'Hello~'/n 5 |/n 6 | const rootDom = document.querySelector('#root')!","id":"/playground-temp/eslint-default/src/main.ts","level":1,"loc":{"column":5,"file":"/playground-temp/eslint-default/src/main.ts","line":3},"message":"'count' is never reassigned. Use 'const' instead. (prefer-const)","stack":""},{"checkerId":"ESLint","frame":" 2 |/n 3 | let count: string = 0/n > 4 | var hello = 'Hello~'/n | ^^^^^^^^^^^^^^^^^^^^/n 5 |/n 6 | const rootDom = document.querySelector('#root')!/n 7 | rootDom.innerHTML = hello + text","id":"/playground-temp/eslint-default/src/main.ts","level":1,"loc":{"column":1,"file":"/playground-temp/eslint-default/src/main.ts","line":4},"message":"Unexpected var, use let or const instead. (no-var)","stack":""},{"checkerId":"ESLint","frame":" 4 | var hello = 'Hello~'/n 5 |/n > 6 | const rootDom = document.querySelector('#root')!/n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^/n 7 | rootDom.innerHTML = hello + text/n 8 |/n 9 | export {}","id":"/playground-temp/eslint-default/src/main.ts","level":0,"loc":{"column":17,"file":"/playground-temp/eslint-default/src/main.ts","line":6},"message":"Forbidden non-null assertion. (@typescript-eslint/no-non-null-assertion)","stack":""}]"`; exports[`eslint-default > serve > get initial error and subsequent error 4`] = ` -" WARNING(ESLint) 'count' is assigned a value but never used. (@typescript-eslint/no-unused-vars) +[ + " WARNING(ESLint) 'count' is assigned a value but never used. (@typescript-eslint/no-unused-vars) FILE /playground-temp/eslint-default/src/main.ts:3:5 1 | import { text } from './text' @@ -71,7 +66,8 @@ exports[`eslint-default > serve > get initial error and subsequent error 4`] = ` 4 | var hello = 'Hello~' 5 | 6 | const rootDom = document.querySelector('#root')! - ERROR(ESLint) 'count' is never reassigned. Use 'const' instead. (prefer-const) +", + " ERROR(ESLint) 'count' is never reassigned. Use 'const' instead. (prefer-const) FILE /playground-temp/eslint-default/src/main.ts:3:5 1 | import { text } from './text' @@ -81,7 +77,8 @@ exports[`eslint-default > serve > get initial error and subsequent error 4`] = ` 4 | var hello = 'Hello~' 5 | 6 | const rootDom = document.querySelector('#root')! - ERROR(ESLint) Unexpected var, use let or const instead. (no-var) +", + " ERROR(ESLint) Unexpected var, use let or const instead. (no-var) FILE /playground-temp/eslint-default/src/main.ts:4:1 2 | @@ -91,7 +88,8 @@ exports[`eslint-default > serve > get initial error and subsequent error 4`] = ` 5 | 6 | const rootDom = document.querySelector('#root')! 7 | rootDom.innerHTML = hello + text - WARNING(ESLint) Forbidden non-null assertion. (@typescript-eslint/no-non-null-assertion) +", + " WARNING(ESLint) Forbidden non-null assertion. (@typescript-eslint/no-non-null-assertion) FILE /playground-temp/eslint-default/src/main.ts:6:17 4 | var hello = 'Hello~' @@ -101,25 +99,16 @@ exports[`eslint-default > serve > get initial error and subsequent error 4`] = ` 7 | rootDom.innerHTML = hello + text 8 | 9 | export {} -[ESLint] Found 2 errors and 2 warnings - ERROR(TypeScript) Type 'number' is not assignable to type 'string'. - FILE /playground-temp/eslint-default/src/main.ts:3:5 - - 1 | import { text } from './text' - 2 | - > 3 | let count: string = 0 - | ^^^^^ - 4 | var hello = 'Hello~' - 5 | - 6 | const rootDom = document.querySelector('#root')! - -[TypeScript] Found 1 error. Watching for file changes." +", + "[ESLint] Found 2 errors and 2 warnings", +] `; -exports[`eslint-default > serve > get initial error and subsequent error 5`] = `"[{"checkerId":"ESLint","frame":" 1 | import { text } from './text'/n 2 |/n > 3 | let count: string = 0/n | ^^^^^^^^^^^^^/n 4 | var hello = 'Hello'/n 5 |/n 6 | const rootDom = document.querySelector('#root')!","id":"/playground-temp/eslint-default/src/main.ts","level":0,"loc":{"column":5,"file":"/playground-temp/eslint-default/src/main.ts","line":3},"message":"'count' is assigned a value but never used. (@typescript-eslint/no-unused-vars)","stack":""},{"checkerId":"ESLint","frame":" 1 | import { text } from './text'/n 2 |/n > 3 | let count: string = 0/n | ^^^^^^^^^^^^^/n 4 | var hello = 'Hello'/n 5 |/n 6 | const rootDom = document.querySelector('#root')!","id":"/playground-temp/eslint-default/src/main.ts","level":1,"loc":{"column":5,"file":"/playground-temp/eslint-default/src/main.ts","line":3},"message":"'count' is never reassigned. Use 'const' instead. (prefer-const)","stack":""},{"checkerId":"ESLint","frame":" 2 |/n 3 | let count: string = 0/n > 4 | var hello = 'Hello'/n | ^^^^^^^^^^^^^^^^^^^/n 5 |/n 6 | const rootDom = document.querySelector('#root')!/n 7 | rootDom.innerHTML = hello + text","id":"/playground-temp/eslint-default/src/main.ts","level":1,"loc":{"column":1,"file":"/playground-temp/eslint-default/src/main.ts","line":4},"message":"Unexpected var, use let or const instead. (no-var)","stack":""},{"checkerId":"ESLint","frame":" 4 | var hello = 'Hello'/n 5 |/n > 6 | const rootDom = document.querySelector('#root')!/n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^/n 7 | rootDom.innerHTML = hello + text/n 8 |/n 9 | export {}","id":"/playground-temp/eslint-default/src/main.ts","level":0,"loc":{"column":17,"file":"/playground-temp/eslint-default/src/main.ts","line":6},"message":"Forbidden non-null assertion. (@typescript-eslint/no-non-null-assertion)","stack":""},{"checkerId":"TypeScript","frame":" 1 | import { text } from './text'/n 2 |/n > 3 | let count: string = 0/n | ^^^^^/n 4 | var hello = 'Hello'/n 5 |/n 6 | const rootDom = document.querySelector('#root')!","id":"/playground-temp/eslint-default/src/main.ts","level":1,"loc":{"column":5,"file":"/playground-temp/eslint-default/src/main.ts","line":3},"message":"Type 'number' is not assignable to type 'string'.","stack":""},{"checkerId":"ESLint","frame":" 1 | import { text } from './text'/n 2 |/n > 3 | let count: string = 0/n | ^^^^^^^^^^^^^/n 4 | var hello = 'Hello~'/n 5 |/n 6 | const rootDom = document.querySelector('#root')!","id":"/playground-temp/eslint-default/src/main.ts","level":0,"loc":{"column":5,"file":"/playground-temp/eslint-default/src/main.ts","line":3},"message":"'count' is assigned a value but never used. (@typescript-eslint/no-unused-vars)","stack":""},{"checkerId":"ESLint","frame":" 1 | import { text } from './text'/n 2 |/n > 3 | let count: string = 0/n | ^^^^^^^^^^^^^/n 4 | var hello = 'Hello~'/n 5 |/n 6 | const rootDom = document.querySelector('#root')!","id":"/playground-temp/eslint-default/src/main.ts","level":1,"loc":{"column":5,"file":"/playground-temp/eslint-default/src/main.ts","line":3},"message":"'count' is never reassigned. Use 'const' instead. (prefer-const)","stack":""},{"checkerId":"ESLint","frame":" 2 |/n 3 | let count: string = 0/n > 4 | var hello = 'Hello~'/n | ^^^^^^^^^^^^^^^^^^^^/n 5 |/n 6 | const rootDom = document.querySelector('#root')!/n 7 | rootDom.innerHTML = hello + text","id":"/playground-temp/eslint-default/src/main.ts","level":1,"loc":{"column":1,"file":"/playground-temp/eslint-default/src/main.ts","line":4},"message":"Unexpected var, use let or const instead. (no-var)","stack":""},{"checkerId":"ESLint","frame":" 4 | var hello = 'Hello~'/n 5 |/n > 6 | const rootDom = document.querySelector('#root')!/n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^/n 7 | rootDom.innerHTML = hello + text/n 8 |/n 9 | export {}","id":"/playground-temp/eslint-default/src/main.ts","level":0,"loc":{"column":17,"file":"/playground-temp/eslint-default/src/main.ts","line":6},"message":"Forbidden non-null assertion. (@typescript-eslint/no-non-null-assertion)","stack":""},{"checkerId":"TypeScript","frame":" 1 | import { text } from './text'/n 2 |/n > 3 | let count: string = 0/n | ^^^^^/n 4 | var hello = 'Hello~'/n 5 |/n 6 | const rootDom = document.querySelector('#root')!","id":"/playground-temp/eslint-default/src/main.ts","level":1,"loc":{"column":5,"file":"/playground-temp/eslint-default/src/main.ts","line":3},"message":"Type 'number' is not assignable to type 'string'.","stack":""},{"checkerId":"ESLint","frame":" 1 | import { text } from './text'/n 2 |/n > 3 | let count: string = 0/n | ^^^^^^^^^^^^^/n 4 | var hello = 'Hello~'/n 5 |/n 6 | const rootDom = document.querySelector('#root')!","id":"/playground-temp/eslint-default/src/main.ts","level":0,"loc":{"column":5,"file":"/playground-temp/eslint-default/src/main.ts","line":3},"message":"'count' is assigned a value but never used. (@typescript-eslint/no-unused-vars)","stack":""},{"checkerId":"ESLint","frame":" 1 | import { text } from './text'/n 2 |/n > 3 | let count: string = 0/n | ^^^^^^^^^^^^^/n 4 | var hello = 'Hello~'/n 5 |/n 6 | const rootDom = document.querySelector('#root')!","id":"/playground-temp/eslint-default/src/main.ts","level":1,"loc":{"column":5,"file":"/playground-temp/eslint-default/src/main.ts","line":3},"message":"'count' is never reassigned. Use 'const' instead. (prefer-const)","stack":""},{"checkerId":"ESLint","frame":" 2 |/n 3 | let count: string = 0/n > 4 | var hello = 'Hello~'/n | ^^^^^^^^^^^^^^^^^^^^/n 5 |/n 6 | const rootDom = document.querySelector('#root')!/n 7 | rootDom.innerHTML = hello + text","id":"/playground-temp/eslint-default/src/main.ts","level":1,"loc":{"column":1,"file":"/playground-temp/eslint-default/src/main.ts","line":4},"message":"Unexpected var, use let or const instead. (no-var)","stack":""},{"checkerId":"ESLint","frame":" 4 | var hello = 'Hello~'/n 5 |/n > 6 | const rootDom = document.querySelector('#root')!/n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^/n 7 | rootDom.innerHTML = hello + text/n 8 |/n 9 | export {}","id":"/playground-temp/eslint-default/src/main.ts","level":0,"loc":{"column":17,"file":"/playground-temp/eslint-default/src/main.ts","line":6},"message":"Forbidden non-null assertion. (@typescript-eslint/no-non-null-assertion)","stack":""},{"checkerId":"TypeScript","frame":" 1 | import { text } from './text'/n 2 |/n > 3 | let count: string = 0/n | ^^^^^/n 4 | var hello = 'Hello~'/n 5 |/n 6 | const rootDom = document.querySelector('#root')!","id":"/playground-temp/eslint-default/src/main.ts","level":1,"loc":{"column":5,"file":"/playground-temp/eslint-default/src/main.ts","line":3},"message":"Type 'number' is not assignable to type 'string'.","stack":""}]"`; +exports[`eslint-default > serve > get initial error and subsequent error 5`] = `"[{"checkerId":"ESLint","frame":" 1 | import { text } from './text'/n 2 |/n > 3 | let count: string = 0/n | ^^^^^^^^^^^^^/n 4 | var hello = 'Hello'/n 5 |/n 6 | const rootDom = document.querySelector('#root')!","id":"/playground-temp/eslint-default/src/main.ts","level":0,"loc":{"column":5,"file":"/playground-temp/eslint-default/src/main.ts","line":3},"message":"'count' is assigned a value but never used. (@typescript-eslint/no-unused-vars)","stack":""},{"checkerId":"ESLint","frame":" 1 | import { text } from './text'/n 2 |/n > 3 | let count: string = 0/n | ^^^^^^^^^^^^^/n 4 | var hello = 'Hello'/n 5 |/n 6 | const rootDom = document.querySelector('#root')!","id":"/playground-temp/eslint-default/src/main.ts","level":1,"loc":{"column":5,"file":"/playground-temp/eslint-default/src/main.ts","line":3},"message":"'count' is never reassigned. Use 'const' instead. (prefer-const)","stack":""},{"checkerId":"ESLint","frame":" 2 |/n 3 | let count: string = 0/n > 4 | var hello = 'Hello'/n | ^^^^^^^^^^^^^^^^^^^/n 5 |/n 6 | const rootDom = document.querySelector('#root')!/n 7 | rootDom.innerHTML = hello + text","id":"/playground-temp/eslint-default/src/main.ts","level":1,"loc":{"column":1,"file":"/playground-temp/eslint-default/src/main.ts","line":4},"message":"Unexpected var, use let or const instead. (no-var)","stack":""},{"checkerId":"ESLint","frame":" 4 | var hello = 'Hello'/n 5 |/n > 6 | const rootDom = document.querySelector('#root')!/n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^/n 7 | rootDom.innerHTML = hello + text/n 8 |/n 9 | export {}","id":"/playground-temp/eslint-default/src/main.ts","level":0,"loc":{"column":17,"file":"/playground-temp/eslint-default/src/main.ts","line":6},"message":"Forbidden non-null assertion. (@typescript-eslint/no-non-null-assertion)","stack":""},{"checkerId":"ESLint","frame":" 1 | import { text } from './text'/n 2 |/n > 3 | let count: string = 0/n | ^^^^^^^^^^^^^/n 4 | var hello = 'Hello~'/n 5 |/n 6 | const rootDom = document.querySelector('#root')!","id":"/playground-temp/eslint-default/src/main.ts","level":0,"loc":{"column":5,"file":"/playground-temp/eslint-default/src/main.ts","line":3},"message":"'count' is assigned a value but never used. (@typescript-eslint/no-unused-vars)","stack":""},{"checkerId":"ESLint","frame":" 1 | import { text } from './text'/n 2 |/n > 3 | let count: string = 0/n | ^^^^^^^^^^^^^/n 4 | var hello = 'Hello~'/n 5 |/n 6 | const rootDom = document.querySelector('#root')!","id":"/playground-temp/eslint-default/src/main.ts","level":1,"loc":{"column":5,"file":"/playground-temp/eslint-default/src/main.ts","line":3},"message":"'count' is never reassigned. Use 'const' instead. (prefer-const)","stack":""},{"checkerId":"ESLint","frame":" 2 |/n 3 | let count: string = 0/n > 4 | var hello = 'Hello~'/n | ^^^^^^^^^^^^^^^^^^^^/n 5 |/n 6 | const rootDom = document.querySelector('#root')!/n 7 | rootDom.innerHTML = hello + text","id":"/playground-temp/eslint-default/src/main.ts","level":1,"loc":{"column":1,"file":"/playground-temp/eslint-default/src/main.ts","line":4},"message":"Unexpected var, use let or const instead. (no-var)","stack":""},{"checkerId":"ESLint","frame":" 4 | var hello = 'Hello~'/n 5 |/n > 6 | const rootDom = document.querySelector('#root')!/n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^/n 7 | rootDom.innerHTML = hello + text/n 8 |/n 9 | export {}","id":"/playground-temp/eslint-default/src/main.ts","level":0,"loc":{"column":17,"file":"/playground-temp/eslint-default/src/main.ts","line":6},"message":"Forbidden non-null assertion. (@typescript-eslint/no-non-null-assertion)","stack":""},{"checkerId":"ESLint","frame":" 1 | import { text } from './text'/n 2 |/n > 3 | let count: string = 0/n | ^^^^^^^^^^^^^/n 4 | var hello = 'Hello~'/n 5 |/n 6 | const rootDom = document.querySelector('#root')!","id":"/playground-temp/eslint-default/src/main.ts","level":0,"loc":{"column":5,"file":"/playground-temp/eslint-default/src/main.ts","line":3},"message":"'count' is assigned a value but never used. (@typescript-eslint/no-unused-vars)","stack":""},{"checkerId":"ESLint","frame":" 1 | import { text } from './text'/n 2 |/n > 3 | let count: string = 0/n | ^^^^^^^^^^^^^/n 4 | var hello = 'Hello~'/n 5 |/n 6 | const rootDom = document.querySelector('#root')!","id":"/playground-temp/eslint-default/src/main.ts","level":1,"loc":{"column":5,"file":"/playground-temp/eslint-default/src/main.ts","line":3},"message":"'count' is never reassigned. Use 'const' instead. (prefer-const)","stack":""},{"checkerId":"ESLint","frame":" 2 |/n 3 | let count: string = 0/n > 4 | var hello = 'Hello~'/n | ^^^^^^^^^^^^^^^^^^^^/n 5 |/n 6 | const rootDom = document.querySelector('#root')!/n 7 | rootDom.innerHTML = hello + text","id":"/playground-temp/eslint-default/src/main.ts","level":1,"loc":{"column":1,"file":"/playground-temp/eslint-default/src/main.ts","line":4},"message":"Unexpected var, use let or const instead. (no-var)","stack":""},{"checkerId":"ESLint","frame":" 4 | var hello = 'Hello~'/n 5 |/n > 6 | const rootDom = document.querySelector('#root')!/n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^/n 7 | rootDom.innerHTML = hello + text/n 8 |/n 9 | export {}","id":"/playground-temp/eslint-default/src/main.ts","level":0,"loc":{"column":17,"file":"/playground-temp/eslint-default/src/main.ts","line":6},"message":"Forbidden non-null assertion. (@typescript-eslint/no-non-null-assertion)","stack":""}]"`; exports[`eslint-default > serve > get initial error and subsequent error 6`] = ` -" WARNING(ESLint) 'count' is assigned a value but never used. (@typescript-eslint/no-unused-vars) +[ + " WARNING(ESLint) 'count' is assigned a value but never used. (@typescript-eslint/no-unused-vars) FILE /playground-temp/eslint-default/src/main.ts:3:5 1 | import { text } from './text' @@ -129,7 +118,8 @@ exports[`eslint-default > serve > get initial error and subsequent error 6`] = ` 4 | var hello = 'Hello~' 5 | 6 | const rootDom = document.querySelector('#root')! - ERROR(ESLint) 'count' is never reassigned. Use 'const' instead. (prefer-const) +", + " ERROR(ESLint) 'count' is never reassigned. Use 'const' instead. (prefer-const) FILE /playground-temp/eslint-default/src/main.ts:3:5 1 | import { text } from './text' @@ -139,7 +129,8 @@ exports[`eslint-default > serve > get initial error and subsequent error 6`] = ` 4 | var hello = 'Hello~' 5 | 6 | const rootDom = document.querySelector('#root')! - ERROR(ESLint) Unexpected var, use let or const instead. (no-var) +", + " ERROR(ESLint) Unexpected var, use let or const instead. (no-var) FILE /playground-temp/eslint-default/src/main.ts:4:1 2 | @@ -149,7 +140,8 @@ exports[`eslint-default > serve > get initial error and subsequent error 6`] = ` 5 | 6 | const rootDom = document.querySelector('#root')! 7 | rootDom.innerHTML = hello + text - WARNING(ESLint) Forbidden non-null assertion. (@typescript-eslint/no-non-null-assertion) +", + " WARNING(ESLint) Forbidden non-null assertion. (@typescript-eslint/no-non-null-assertion) FILE /playground-temp/eslint-default/src/main.ts:6:17 4 | var hello = 'Hello~' @@ -159,17 +151,7 @@ exports[`eslint-default > serve > get initial error and subsequent error 6`] = ` 7 | rootDom.innerHTML = hello + text 8 | 9 | export {} -[ESLint] Found 2 errors and 2 warnings - ERROR(TypeScript) Type 'number' is not assignable to type 'string'. - FILE /playground-temp/eslint-default/src/main.ts:3:5 - - 1 | import { text } from './text' - 2 | - > 3 | let count: string = 0 - | ^^^^^ - 4 | var hello = 'Hello~' - 5 | - 6 | const rootDom = document.querySelector('#root')! - -[TypeScript] Found 1 error. Watching for file changes." +", + "[ESLint] Found 2 errors and 2 warnings", +] `; diff --git a/playground/eslint-default/vite.config.js b/playground/eslint-default/vite.config.js index cd58c179..a11068b1 100644 --- a/playground/eslint-default/vite.config.js +++ b/playground/eslint-default/vite.config.js @@ -4,10 +4,8 @@ import checker from 'vite-plugin-checker' export default defineConfig({ plugins: [ checker({ - typescript: true, eslint: { lintCommand: 'eslint ./src --ext .ts', - // dev: { logLevel: ['warning'] }, }, }), ], diff --git a/playground/eslint-flat/__tests__/__snapshots__/test.spec.ts.snap b/playground/eslint-flat/__tests__/__snapshots__/test.spec.ts.snap index 4745d213..874906b4 100644 --- a/playground/eslint-flat/__tests__/__snapshots__/test.spec.ts.snap +++ b/playground/eslint-flat/__tests__/__snapshots__/test.spec.ts.snap @@ -3,25 +3,31 @@ exports[`eslint > serve > get initial error and subsequent error 1`] = `"[{"checkerId":"ESLint","frame":" > 1 | const a = /"hello/"/n | ^/n > 2 |/n | ^","id":"/playground-temp/eslint-flat/src/index.js","level":1,"loc":{"column":18,"file":"/playground-temp/eslint-flat/src/index.js","line":1},"message":"Missing semicolon. (semi)","stack":""}]"`; exports[`eslint > serve > get initial error and subsequent error 2`] = ` -" ERROR(ESLint) Missing semicolon. (semi) +[ + " ERROR(ESLint) Missing semicolon. (semi) FILE /playground-temp/eslint-flat/src/index.js:1:18 > 1 | const a = "hello" | ^ > 2 | | ^ -[ESLint] Found 1 error and 0 warning" +", + "[ESLint] Found 1 error and 0 warning", +] `; exports[`eslint > serve > get initial error and subsequent error 3`] = `"[{"checkerId":"ESLint","frame":" > 1 | const a = /"hello/"/n | ^/n > 2 |/n | ^","id":"/playground-temp/eslint-flat/src/index.js","level":1,"loc":{"column":18,"file":"/playground-temp/eslint-flat/src/index.js","line":1},"message":"Missing semicolon. (semi)","stack":""},{"checkerId":"ESLint","frame":" > 1 | const a = /"hello/"/n | ^/n > 2 |/n | ^","id":"/playground-temp/eslint-flat/src/index.js","level":1,"loc":{"column":18,"file":"/playground-temp/eslint-flat/src/index.js","line":1},"message":"Missing semicolon. (semi)","stack":""}]"`; exports[`eslint > serve > get initial error and subsequent error 4`] = ` -" ERROR(ESLint) Missing semicolon. (semi) +[ + " ERROR(ESLint) Missing semicolon. (semi) FILE /playground-temp/eslint-flat/src/index.js:1:18 > 1 | const a = "hello" | ^ > 2 | | ^ -[ESLint] Found 1 error and 0 warning" +", + "[ESLint] Found 1 error and 0 warning", +] `; diff --git a/playground/multiple-hmr/__tests__/__snapshots__/test.spec.ts.snap b/playground/multiple-hmr/__tests__/__snapshots__/test.spec.ts.snap index 93d4b6e3..9b1f3935 100644 --- a/playground/multiple-hmr/__tests__/__snapshots__/test.spec.ts.snap +++ b/playground/multiple-hmr/__tests__/__snapshots__/test.spec.ts.snap @@ -3,13 +3,8 @@ exports[`multiple-hmr > serve > get initial error and subsequent error 1`] = `"[{"checkerId":"ESLint","frame":" > 1 | export var value: string = 1/n | ^^^^^^^^^^^^^^^^^^^^^/n 2 |","id":"/playground-temp/multiple-hmr/src/value.ts","level":1,"loc":{"column":8,"file":"/playground-temp/multiple-hmr/src/value.ts","line":1},"message":"Unexpected var, use let or const instead. (no-var)","stack":""},{"checkerId":"TypeScript","frame":" > 1 | export var value: string = 1/n | ^^^^^/n 2 |","id":"/playground-temp/multiple-hmr/src/value.ts","level":1,"loc":{"column":12,"file":"/playground-temp/multiple-hmr/src/value.ts","line":1},"message":"Type 'number' is not assignable to type 'string'.","stack":""}]"`; exports[`multiple-hmr > serve > get initial error and subsequent error 2`] = ` -" ERROR(ESLint) Unexpected var, use let or const instead. (no-var) - FILE /playground-temp/multiple-hmr/src/value.ts:1:8 - - > 1 | export var value: string = 1 - | ^^^^^^^^^^^^^^^^^^^^^ - 2 | -[ESLint] Found 1 error and 0 warning +[ + " ERROR(TypeScript) Type 'number' is not assignable to type 'string'. FILE /playground-temp/multiple-hmr/src/value.ts:1:12 @@ -17,7 +12,16 @@ exports[`multiple-hmr > serve > get initial error and subsequent error 2`] = ` | ^^^^^ 2 | -[TypeScript] Found 1 error. Watching for file changes." +[TypeScript] Found 1 error. Watching for file changes.", + " ERROR(ESLint) Unexpected var, use let or const instead. (no-var) + FILE /playground-temp/multiple-hmr/src/value.ts:1:8 + + > 1 | export var value: string = 1 + | ^^^^^^^^^^^^^^^^^^^^^ + 2 | +", + "[ESLint] Found 1 error and 0 warning", +] `; exports[`multiple-hmr > serve > get initial error and subsequent error 3`] = `"[{"checkerId":"ESLint","frame":" > 1 | export var value: string = 2/n | ^^^^^^^^^^^^^^^^^^^^^/n 2 |","id":"/playground-temp/multiple-hmr/src/value.ts","level":1,"loc":{"column":8,"file":"/playground-temp/multiple-hmr/src/value.ts","line":1},"message":"Unexpected var, use let or const instead. (no-var)","stack":""},{"checkerId":"TypeScript","frame":" > 1 | export var value: string = 2/n | ^^^^^/n 2 |","id":"/playground-temp/multiple-hmr/src/value.ts","level":1,"loc":{"column":12,"file":"/playground-temp/multiple-hmr/src/value.ts","line":1},"message":"Type 'number' is not assignable to type 'string'.","stack":""}]"`; diff --git a/playground/multiple-hmr/__tests__/test.spec.ts b/playground/multiple-hmr/__tests__/test.spec.ts index b4c40f18..1ca5bd6e 100644 --- a/playground/multiple-hmr/__tests__/test.spec.ts +++ b/playground/multiple-hmr/__tests__/test.spec.ts @@ -10,6 +10,7 @@ import { isServe, resetDiagnostics, resetReceivedLog, + log, sleepForEdit, sleepForServerReady, stripedLog, @@ -20,7 +21,7 @@ describe('multiple-hmr', () => { it('get initial error and subsequent error', async () => { await sleepForServerReady() expect(stringify(stable(diagnostics))).toMatchSnapshot() - expect(stripedLog).toMatchSnapshot() + expect(stable(stripedLog)).toMatchSnapshot() console.log('-- edit with error --') resetDiagnostics() @@ -60,7 +61,7 @@ describe('multiple-hmr', () => { ] it('should fail', async () => { - expectStderrContains(stripedLog, expectedMsg) + expectStderrContains(log, expectedMsg) }) }) }) diff --git a/playground/multiple-reload/__tests__/__snapshots__/test.spec.ts.snap b/playground/multiple-reload/__tests__/__snapshots__/test.spec.ts.snap index f32dd8e0..847159bd 100644 --- a/playground/multiple-reload/__tests__/__snapshots__/test.spec.ts.snap +++ b/playground/multiple-reload/__tests__/__snapshots__/test.spec.ts.snap @@ -3,7 +3,21 @@ exports[`multiple-reload > serve > get initial error and subsequent error 1`] = `"[{"checkerId":"ESLint","frame":" 1 | import { text } from './text'/n 2 |/n > 3 | var count: string = 0/n | ^^^^^^^^^^^^^^^^^^^^^/n 4 | const hello = 'Hello'/n 5 |/n 6 | const rootDom = document.querySelector('#root')!","id":"/playground-temp/multiple-reload/src/main.ts","level":1,"loc":{"column":1,"file":"/playground-temp/multiple-reload/src/main.ts","line":3},"message":"Unexpected var, use let or const instead. (no-var)","stack":""},{"checkerId":"ESLint","frame":" 4 | const hello = 'Hello'/n 5 |/n > 6 | const rootDom = document.querySelector('#root')!/n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^/n 7 | rootDom.innerHTML = hello + text + count/n 8 |/n 9 | export {}","id":"/playground-temp/multiple-reload/src/main.ts","level":0,"loc":{"column":17,"file":"/playground-temp/multiple-reload/src/main.ts","line":6},"message":"Forbidden non-null assertion. (@typescript-eslint/no-non-null-assertion)","stack":""},{"checkerId":"TypeScript","frame":" 1 | import { text } from './text'/n 2 |/n > 3 | var count: string = 0/n | ^^^^^/n 4 | const hello = 'Hello'/n 5 |/n 6 | const rootDom = document.querySelector('#root')!","id":"/playground-temp/multiple-reload/src/main.ts","level":1,"loc":{"column":5,"file":"/playground-temp/multiple-reload/src/main.ts","line":3},"message":"Type 'number' is not assignable to type 'string'.","stack":""}]"`; exports[`multiple-reload > serve > get initial error and subsequent error 2`] = ` -" ERROR(ESLint) Unexpected var, use let or const instead. (no-var) +[ + " + ERROR(TypeScript) Type 'number' is not assignable to type 'string'. + FILE /playground-temp/multiple-reload/src/main.ts:3:5 + + 1 | import { text } from './text' + 2 | + > 3 | var count: string = 0 + | ^^^^^ + 4 | const hello = 'Hello' + 5 | + 6 | const rootDom = document.querySelector('#root')! + +[TypeScript] Found 1 error. Watching for file changes.", + " ERROR(ESLint) Unexpected var, use let or const instead. (no-var) FILE /playground-temp/multiple-reload/src/main.ts:3:1 1 | import { text } from './text' @@ -13,7 +27,8 @@ exports[`multiple-reload > serve > get initial error and subsequent error 2`] = 4 | const hello = 'Hello' 5 | 6 | const rootDom = document.querySelector('#root')! - WARNING(ESLint) Forbidden non-null assertion. (@typescript-eslint/no-non-null-assertion) +", + " WARNING(ESLint) Forbidden non-null assertion. (@typescript-eslint/no-non-null-assertion) FILE /playground-temp/multiple-reload/src/main.ts:6:17 4 | const hello = 'Hello' @@ -23,19 +38,9 @@ exports[`multiple-reload > serve > get initial error and subsequent error 2`] = 7 | rootDom.innerHTML = hello + text + count 8 | 9 | export {} -[ESLint] Found 1 error and 1 warning - ERROR(TypeScript) Type 'number' is not assignable to type 'string'. - FILE /playground-temp/multiple-reload/src/main.ts:3:5 - - 1 | import { text } from './text' - 2 | - > 3 | var count: string = 0 - | ^^^^^ - 4 | const hello = 'Hello' - 5 | - 6 | const rootDom = document.querySelector('#root')! - -[TypeScript] Found 1 error. Watching for file changes." +", + "[ESLint] Found 1 error and 1 warning", +] `; exports[`multiple-reload > serve > get initial error and subsequent error 3`] = `"[{"checkerId":"ESLint","frame":" 1 | import { text } from './text'/n 2 |/n > 3 | var count: string = 0/n | ^^^^^^^^^^^^^^^^^^^^^/n 4 | const hello = 'Hello'/n 5 |/n 6 | const rootDom = document.querySelector('#root')!","id":"/playground-temp/multiple-reload/src/main.ts","level":1,"loc":{"column":1,"file":"/playground-temp/multiple-reload/src/main.ts","line":3},"message":"Unexpected var, use let or const instead. (no-var)","stack":""},{"checkerId":"ESLint","frame":" 4 | const hello = 'Hello'/n 5 |/n > 6 | const rootDom = document.querySelector('#root')!/n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^/n 7 | rootDom.innerHTML = hello + text + count/n 8 |/n 9 | export {}","id":"/playground-temp/multiple-reload/src/main.ts","level":0,"loc":{"column":17,"file":"/playground-temp/multiple-reload/src/main.ts","line":6},"message":"Forbidden non-null assertion. (@typescript-eslint/no-non-null-assertion)","stack":""}]"`; diff --git a/playground/multiple-reload/__tests__/test.spec.ts b/playground/multiple-reload/__tests__/test.spec.ts index 32b2778f..822cbdbf 100644 --- a/playground/multiple-reload/__tests__/test.spec.ts +++ b/playground/multiple-reload/__tests__/test.spec.ts @@ -10,6 +10,7 @@ import { isServe, resetDiagnostics, resetReceivedLog, + log, sleepForEdit, sleepForServerReady, stripedLog, @@ -20,7 +21,7 @@ describe('multiple-reload', () => { it('get initial error and subsequent error', async () => { await sleepForServerReady() expect(stringify(stable(diagnostics))).toMatchSnapshot() - expect(stripedLog).toMatchSnapshot() + expect(stable(stripedLog)).toMatchSnapshot() console.log('-- edit with error --') resetDiagnostics() @@ -33,7 +34,7 @@ describe('multiple-reload', () => { // don't know why striped log in disorder on Linux, while correct on mac and Windows // comment out for now to pass test cases stably and striped log is duplicated with diagnostics somehow. // Need help to figure out what went wrong. 😅 - // expect(stripedLog).toMatchSnapshot() + // expect(stable(stripedLog)).toMatchSnapshot() console.log('-- fix typescript error --') resetDiagnostics() @@ -60,7 +61,7 @@ describe('multiple-reload', () => { ] it('should fail', async () => { - expectStderrContains(stripedLog, expectedMsg) + expectStderrContains(log, expectedMsg) }) }) }) diff --git a/playground/stylelint-default/__tests__/__snapshots__/test.spec.ts.snap b/playground/stylelint-default/__tests__/__snapshots__/test.spec.ts.snap index b8bf4290..81919950 100644 --- a/playground/stylelint-default/__tests__/__snapshots__/test.spec.ts.snap +++ b/playground/stylelint-default/__tests__/__snapshots__/test.spec.ts.snap @@ -3,7 +3,8 @@ exports[`stylelint > serve > get initial error and subsequent error 1`] = `"[{"checkerId":"Stylelint","frame":" > 1 | #root {/n | ^/n > 2 | }/n | ^^/n 3 |/n 4 | body {/n 5 | color: rgb(0, 0, 0);","id":"/playground-temp/stylelint-default/src/style.css","level":1,"loc":{"column":7,"file":"/playground-temp/stylelint-default/src/style.css","line":1},"message":"Unexpected empty block (block-no-empty) (block-no-empty)","stack":""},{"checkerId":"Stylelint","frame":" 3 |/n 4 | body {/n > 5 | color: rgb(0, 0, 0);/n | ^^^^^^^^^^^^/n 6 | }/n 7 |","id":"/playground-temp/stylelint-default/src/style.css","level":1,"loc":{"column":10,"file":"/playground-temp/stylelint-default/src/style.css","line":5},"message":"Expected modern color-function notation (color-function-notation) (color-function-notation)","stack":""}]"`; exports[`stylelint > serve > get initial error and subsequent error 2`] = ` -" ERROR(Stylelint) Unexpected empty block (block-no-empty) (block-no-empty) +[ + " ERROR(Stylelint) Unexpected empty block (block-no-empty) (block-no-empty) FILE /playground-temp/stylelint-default/src/style.css:1:7 > 1 | #root { @@ -13,7 +14,8 @@ exports[`stylelint > serve > get initial error and subsequent error 2`] = ` 3 | 4 | body { 5 | color: rgb(0, 0, 0); - ERROR(Stylelint) Expected modern color-function notation (color-function-notation) (color-function-notation) +", + " ERROR(Stylelint) Expected modern color-function notation (color-function-notation) (color-function-notation) FILE /playground-temp/stylelint-default/src/style.css:5:10 3 | @@ -22,13 +24,16 @@ exports[`stylelint > serve > get initial error and subsequent error 2`] = ` | ^^^^^^^^^^^^ 6 | } 7 | -[Stylelint] Found 2 errors and 0 warning" +", + "[Stylelint] Found 2 errors and 0 warning", +] `; exports[`stylelint > serve > get initial error and subsequent error 3`] = `"[{"checkerId":"Stylelint","frame":" > 1 | #root {/n | ^/n > 2 | }/n | ^^/n 3 |/n 4 | body {/n 5 | color: rgb(0, 0, 0);","id":"/playground-temp/stylelint-default/src/style.css","level":1,"loc":{"column":7,"file":"/playground-temp/stylelint-default/src/style.css","line":1},"message":"Unexpected empty block (block-no-empty) (block-no-empty)","stack":""},{"checkerId":"Stylelint","frame":" 3 |/n 4 | body {/n > 5 | color: rgb(0, 0, 0);/n | ^^^^^^^^^^^^/n 6 | }/n 7 |","id":"/playground-temp/stylelint-default/src/style.css","level":1,"loc":{"column":10,"file":"/playground-temp/stylelint-default/src/style.css","line":5},"message":"Expected modern color-function notation (color-function-notation) (color-function-notation)","stack":""},{"checkerId":"Stylelint","frame":" > 1 | #root {/n | ^/n > 2 | }/n | ^^/n 3 |/n 4 | body {/n 5 | color: #fff;","id":"/playground-temp/stylelint-default/src/style.css","level":1,"loc":{"column":7,"file":"/playground-temp/stylelint-default/src/style.css","line":1},"message":"Unexpected empty block (block-no-empty) (block-no-empty)","stack":""}]"`; exports[`stylelint > serve > get initial error and subsequent error 4`] = ` -" ERROR(Stylelint) Unexpected empty block (block-no-empty) (block-no-empty) +[ + " ERROR(Stylelint) Unexpected empty block (block-no-empty) (block-no-empty) FILE /playground-temp/stylelint-default/src/style.css:1:7 > 1 | #root { @@ -38,5 +43,7 @@ exports[`stylelint > serve > get initial error and subsequent error 4`] = ` 3 | 4 | body { 5 | color: #fff; -[Stylelint] Found 1 error and 0 warning" +", + "[Stylelint] Found 1 error and 0 warning", +] `; diff --git a/playground/testUtils.ts b/playground/testUtils.ts index c9e0e556..b44fcad7 100644 --- a/playground/testUtils.ts +++ b/playground/testUtils.ts @@ -23,10 +23,12 @@ export function editFileTo(filename: string, content: string): void { fs.writeFileSync(filePath, content) } -export function expectStderrContains(str: string, expectedErrorMsg: string | string[]) { +export function expectStderrContains(str: string | string[], expectedErrorMsg: string | string[]) { + const strArr = Array.isArray(str) ? str : [str] const errorMsgArr = Array.isArray(expectedErrorMsg) ? expectedErrorMsg : [expectedErrorMsg] errorMsgArr.forEach((msg) => { - expect(str).toContain(msg) + const found = strArr.some((str) => str.includes(msg)) + expect(found).toBe(true) }) } diff --git a/playground/typescript-react/__tests__/__snapshots__/test.spec.ts.snap b/playground/typescript-react/__tests__/__snapshots__/test.spec.ts.snap index c90ae331..d3e0447c 100644 --- a/playground/typescript-react/__tests__/__snapshots__/test.spec.ts.snap +++ b/playground/typescript-react/__tests__/__snapshots__/test.spec.ts.snap @@ -3,7 +3,8 @@ exports[`typescript-react > serve > get initial error and subsequent error 1`] = `"[{"checkerId":"TypeScript","frame":" 4 |/n 5 | function App() {/n > 6 | const [count, setCount] = useState(1)/n | ^/n 7 | return (/n 8 |
/n 9 |
","id":"/playground-temp/typescript-react/src/App.tsx","level":1,"loc":{"column":46,"file":"/playground-temp/typescript-react/src/App.tsx","line":6},"message":"Argument of type 'number' is not assignable to parameter of type 'string | (() => string)'.","stack":""}]"`; exports[`typescript-react > serve > get initial error and subsequent error 2`] = ` -" +[ + " ERROR(TypeScript) Argument of type 'number' is not assignable to parameter of type 'string | (() => string)'. FILE /playground-temp/typescript-react/src/App.tsx:6:46 @@ -15,13 +16,15 @@ exports[`typescript-react > serve > get initial error and subsequent error 2`] = 8 |
9 |
-[TypeScript] Found 1 error. Watching for file changes." +[TypeScript] Found 1 error. Watching for file changes.", +] `; exports[`typescript-react > serve > get initial error and subsequent error 3`] = `"[{"checkerId":"TypeScript","frame":" 4 |/n 5 | function App() {/n > 6 | const [count, setCount] = useState(1)/n | ^/n 7 | return (/n 8 |
/n 9 |
","id":"/playground-temp/typescript-react/src/App.tsx","level":1,"loc":{"column":46,"file":"/playground-temp/typescript-react/src/App.tsx","line":6},"message":"Argument of type 'number' is not assignable to parameter of type 'string | (() => string)'.","stack":""},{"checkerId":"TypeScript","frame":" 4 |/n 5 | function App() {/n > 6 | const [count, setCount] = useState(2)/n | ^/n 7 | return (/n 8 |
/n 9 |
","id":"/playground-temp/typescript-react/src/App.tsx","level":1,"loc":{"column":46,"file":"/playground-temp/typescript-react/src/App.tsx","line":6},"message":"Argument of type 'number' is not assignable to parameter of type 'string | (() => string)'.","stack":""}]"`; exports[`typescript-react > serve > get initial error and subsequent error 4`] = ` -" +[ + " ERROR(TypeScript) Argument of type 'number' is not assignable to parameter of type 'string | (() => string)'. FILE /playground-temp/typescript-react/src/App.tsx:6:46 @@ -33,5 +36,6 @@ exports[`typescript-react > serve > get initial error and subsequent error 4`] = 8 |
9 |
-[TypeScript] Found 1 error. Watching for file changes." +[TypeScript] Found 1 error. Watching for file changes.", +] `; diff --git a/playground/vitestSetup.ts b/playground/vitestSetup.ts index b71e4c45..0ebe813d 100644 --- a/playground/vitestSetup.ts +++ b/playground/vitestSetup.ts @@ -53,7 +53,7 @@ export let testName: string export let viteConfig: InlineConfig | undefined export let log = '' -export let stripedLog = '' +export let stripedLog: string[] = [] export let diagnostics: string[] = [] export let buildSucceed: boolean @@ -227,7 +227,7 @@ export async function startDefaultServe({ buildSucceed = true } catch (e) { log = (e as any).toString() - stripedLog += strip(log) + stripedLog.push(strip(log)) buildSucceed = false } } @@ -238,10 +238,10 @@ function setCheckerLoggerForTest(checker: typeof Checker, accumulate = true) { (...args: any[]) => { if (accumulate) { log += args[0].payload - stripedLog += strip(args[0].payload) + stripedLog.push(strip(args[0].payload)) } else { log = args[0].payload - stripedLog = strip(args[0].payload) + stripedLog.push(strip(args[0].payload)) } }, ] @@ -253,7 +253,7 @@ export function slash(p: string): string { export function resetReceivedLog() { log = '' - stripedLog = '' + stripedLog = [] } export function resetDiagnostics() { diff --git a/playground/vls-vue2/__tests__/__snapshots__/test.spec.ts.snap b/playground/vls-vue2/__tests__/__snapshots__/test.spec.ts.snap index 1f6060c1..57c34620 100644 --- a/playground/vls-vue2/__tests__/__snapshots__/test.spec.ts.snap +++ b/playground/vls-vue2/__tests__/__snapshots__/test.spec.ts.snap @@ -3,7 +3,8 @@ exports[`vue2-vls > serve > get initial error and subsequent error 1`] = `"[{"checkerId":"VLS","frame":" 1 |