diff --git a/apps/oxlint/fixtures/tsgolint/await-thenable.ts b/apps/oxlint/fixtures/tsgolint/await-thenable.ts index c9aaf0a5bcdaf..6a4ccdc620a47 100644 --- a/apps/oxlint/fixtures/tsgolint/await-thenable.ts +++ b/apps/oxlint/fixtures/tsgolint/await-thenable.ts @@ -1 +1,3 @@ -await 12; \ No newline at end of file +await 12; + +export {}; diff --git a/apps/oxlint/fixtures/tsgolint/no-confusing-void-expression.ts b/apps/oxlint/fixtures/tsgolint/no-confusing-void-expression.ts index 532bc52c586e3..ae722141c84d0 100644 --- a/apps/oxlint/fixtures/tsgolint/no-confusing-void-expression.ts +++ b/apps/oxlint/fixtures/tsgolint/no-confusing-void-expression.ts @@ -1,2 +1,4 @@ declare function bar(): void; -const foo = () => void bar(); \ No newline at end of file +const foo = () => void bar(); + +export {}; diff --git a/apps/oxlint/fixtures/tsgolint/no-duplicate-type-constituents.ts b/apps/oxlint/fixtures/tsgolint/no-duplicate-type-constituents.ts index 13c05bb83b979..0917796c6882f 100644 --- a/apps/oxlint/fixtures/tsgolint/no-duplicate-type-constituents.ts +++ b/apps/oxlint/fixtures/tsgolint/no-duplicate-type-constituents.ts @@ -1 +1,3 @@ -type T1 = 'A' | 'A'; \ No newline at end of file +type T1 = 'A' | 'A'; + +export {}; diff --git a/apps/oxlint/fixtures/tsgolint/no-floating-promises.ts b/apps/oxlint/fixtures/tsgolint/no-floating-promises.ts index 28edcf1287400..975d807a94c9b 100644 --- a/apps/oxlint/fixtures/tsgolint/no-floating-promises.ts +++ b/apps/oxlint/fixtures/tsgolint/no-floating-promises.ts @@ -1,2 +1,4 @@ const promise = new Promise((resolve, _reject) => resolve("value")); promise; + +export {}; diff --git a/apps/oxlint/fixtures/tsgolint/no-for-in-array.ts b/apps/oxlint/fixtures/tsgolint/no-for-in-array.ts index 52c0599ab19d2..5936383a53f57 100644 --- a/apps/oxlint/fixtures/tsgolint/no-for-in-array.ts +++ b/apps/oxlint/fixtures/tsgolint/no-for-in-array.ts @@ -1,4 +1,6 @@ const arr = [1, 2, 3]; for (const i in arr) { console.log(arr[i]); -} \ No newline at end of file +} + +export {}; diff --git a/apps/oxlint/fixtures/tsgolint/no-meaningless-void-operator.ts b/apps/oxlint/fixtures/tsgolint/no-meaningless-void-operator.ts index 45f2ed0a8b93f..5f30040af1ab7 100644 --- a/apps/oxlint/fixtures/tsgolint/no-meaningless-void-operator.ts +++ b/apps/oxlint/fixtures/tsgolint/no-meaningless-void-operator.ts @@ -1,4 +1,6 @@ function foo(): void { return; } -void foo(); \ No newline at end of file +void foo(); + +export {}; diff --git a/apps/oxlint/fixtures/tsgolint/no-mixed-enums.ts b/apps/oxlint/fixtures/tsgolint/no-mixed-enums.ts index ebe572748a58f..be64f833c767b 100644 --- a/apps/oxlint/fixtures/tsgolint/no-mixed-enums.ts +++ b/apps/oxlint/fixtures/tsgolint/no-mixed-enums.ts @@ -1,4 +1,6 @@ enum Status { Open = 1, Closed = 'closed', -} \ No newline at end of file +} + +export {} \ No newline at end of file diff --git a/apps/oxlint/fixtures/tsgolint/no-unnecessary-template-expression.ts b/apps/oxlint/fixtures/tsgolint/no-unnecessary-template-expression.ts index bb1fccb784e59..0155186c0db37 100644 --- a/apps/oxlint/fixtures/tsgolint/no-unnecessary-template-expression.ts +++ b/apps/oxlint/fixtures/tsgolint/no-unnecessary-template-expression.ts @@ -1 +1,3 @@ -const str1 = `Hello world`; \ No newline at end of file +const str1 = `Hello world`; + +export {}; \ No newline at end of file diff --git a/apps/oxlint/fixtures/tsgolint/no-unnecessary-type-assertion.ts b/apps/oxlint/fixtures/tsgolint/no-unnecessary-type-assertion.ts index 18c3219b9e9a2..9716ff44d20f2 100644 --- a/apps/oxlint/fixtures/tsgolint/no-unnecessary-type-assertion.ts +++ b/apps/oxlint/fixtures/tsgolint/no-unnecessary-type-assertion.ts @@ -1,2 +1,4 @@ const str: string = 'hello'; -const redundant = str as string; \ No newline at end of file +const redundant = str as string; + +export {}; diff --git a/apps/oxlint/fixtures/tsgolint/no-unsafe-argument.ts b/apps/oxlint/fixtures/tsgolint/no-unsafe-argument.ts index d4705ae251ec9..dbfa8a1b4f849 100644 --- a/apps/oxlint/fixtures/tsgolint/no-unsafe-argument.ts +++ b/apps/oxlint/fixtures/tsgolint/no-unsafe-argument.ts @@ -1,3 +1,5 @@ declare const anyValue: any; function takesString(str: string): void {} -takesString(anyValue); \ No newline at end of file +takesString(anyValue); + +export {}; diff --git a/apps/oxlint/fixtures/tsgolint/no-unsafe-assignment.ts b/apps/oxlint/fixtures/tsgolint/no-unsafe-assignment.ts index 8d2b51c96c536..a6e220e337d2b 100644 --- a/apps/oxlint/fixtures/tsgolint/no-unsafe-assignment.ts +++ b/apps/oxlint/fixtures/tsgolint/no-unsafe-assignment.ts @@ -1,2 +1,4 @@ declare const anyValue: any; -const str: string = anyValue; \ No newline at end of file +const str: string = anyValue; + +export {}; diff --git a/apps/oxlint/fixtures/tsgolint/no-unsafe-call.ts b/apps/oxlint/fixtures/tsgolint/no-unsafe-call.ts index a21cd9d82137a..e5faa950409f5 100644 --- a/apps/oxlint/fixtures/tsgolint/no-unsafe-call.ts +++ b/apps/oxlint/fixtures/tsgolint/no-unsafe-call.ts @@ -1,2 +1,4 @@ declare const anyValue: any; -anyValue(); \ No newline at end of file +anyValue(); + +export {}; diff --git a/apps/oxlint/fixtures/tsgolint/no-unsafe-enum-comparison.ts b/apps/oxlint/fixtures/tsgolint/no-unsafe-enum-comparison.ts index d7759e215434e..c5b050eff7056 100644 --- a/apps/oxlint/fixtures/tsgolint/no-unsafe-enum-comparison.ts +++ b/apps/oxlint/fixtures/tsgolint/no-unsafe-enum-comparison.ts @@ -6,4 +6,6 @@ enum Color { Red = 'red', Blue = 'blue', } -const comparison = Status.Open === Color.Red; \ No newline at end of file +const comparison = Status.Open === Color.Red; + +export {}; diff --git a/apps/oxlint/fixtures/tsgolint/no-unsafe-member-access.ts b/apps/oxlint/fixtures/tsgolint/no-unsafe-member-access.ts index 2dc3a11874694..024a154dbe8b1 100644 --- a/apps/oxlint/fixtures/tsgolint/no-unsafe-member-access.ts +++ b/apps/oxlint/fixtures/tsgolint/no-unsafe-member-access.ts @@ -1,2 +1,4 @@ declare const anyValue: any; -anyValue.foo; \ No newline at end of file +anyValue.foo; + +export {}; diff --git a/apps/oxlint/fixtures/tsgolint/no-unsafe-return.ts b/apps/oxlint/fixtures/tsgolint/no-unsafe-return.ts index b4900b1f6ec90..c391225ba8a75 100644 --- a/apps/oxlint/fixtures/tsgolint/no-unsafe-return.ts +++ b/apps/oxlint/fixtures/tsgolint/no-unsafe-return.ts @@ -1,4 +1,6 @@ declare const anyValue: any; function getString(): string { return anyValue; -} \ No newline at end of file +} + +export {}; diff --git a/apps/oxlint/fixtures/tsgolint/no-unsafe-type-assertion.ts b/apps/oxlint/fixtures/tsgolint/no-unsafe-type-assertion.ts index 93e3573261751..8890f78ff1908 100644 --- a/apps/oxlint/fixtures/tsgolint/no-unsafe-type-assertion.ts +++ b/apps/oxlint/fixtures/tsgolint/no-unsafe-type-assertion.ts @@ -1,2 +1,4 @@ declare const value: unknown; -const str = value as any; \ No newline at end of file +const str = value as any; + +export {}; diff --git a/apps/oxlint/fixtures/tsgolint/no-unsafe-unary-minus.ts b/apps/oxlint/fixtures/tsgolint/no-unsafe-unary-minus.ts index e22acab0110b8..32aff401c004f 100644 --- a/apps/oxlint/fixtures/tsgolint/no-unsafe-unary-minus.ts +++ b/apps/oxlint/fixtures/tsgolint/no-unsafe-unary-minus.ts @@ -1,2 +1,4 @@ declare const value: any; -const result1 = -value; \ No newline at end of file +const result1 = -value; + +export {}; diff --git a/apps/oxlint/fixtures/tsgolint/non-nullable-type-assertion-style.ts b/apps/oxlint/fixtures/tsgolint/non-nullable-type-assertion-style.ts index 1a1a94ab142f0..2e7497f35440e 100644 --- a/apps/oxlint/fixtures/tsgolint/non-nullable-type-assertion-style.ts +++ b/apps/oxlint/fixtures/tsgolint/non-nullable-type-assertion-style.ts @@ -1,2 +1,4 @@ declare const value: string | null; -const result1 = value as string; \ No newline at end of file +const result1 = value as string; + +export {}; diff --git a/apps/oxlint/fixtures/tsgolint/non-tsgolint.ts b/apps/oxlint/fixtures/tsgolint/non-tsgolint.ts index eab74692130a6..83efc74e16662 100644 --- a/apps/oxlint/fixtures/tsgolint/non-tsgolint.ts +++ b/apps/oxlint/fixtures/tsgolint/non-tsgolint.ts @@ -1 +1,3 @@ debugger; + +export {}; diff --git a/apps/oxlint/fixtures/tsgolint/only-throw-error.ts b/apps/oxlint/fixtures/tsgolint/only-throw-error.ts index 9224d17d2ae31..cd05a725a6534 100644 --- a/apps/oxlint/fixtures/tsgolint/only-throw-error.ts +++ b/apps/oxlint/fixtures/tsgolint/only-throw-error.ts @@ -1 +1,3 @@ -throw 'error'; \ No newline at end of file +throw 'error'; + +export {}; diff --git a/apps/oxlint/fixtures/tsgolint/prefer-includes.ts b/apps/oxlint/fixtures/tsgolint/prefer-includes.ts index 955148fa3e4fa..548cb7c97f690 100644 --- a/apps/oxlint/fixtures/tsgolint/prefer-includes.ts +++ b/apps/oxlint/fixtures/tsgolint/prefer-includes.ts @@ -8,3 +8,5 @@ if (items.indexOf(1) !== -1) { if (/test/.test(text)) { } + +export {}; diff --git a/apps/oxlint/fixtures/tsgolint/prefer-reduce-type-parameter.ts b/apps/oxlint/fixtures/tsgolint/prefer-reduce-type-parameter.ts index 298a86ec9886a..267c465ff94e1 100644 --- a/apps/oxlint/fixtures/tsgolint/prefer-reduce-type-parameter.ts +++ b/apps/oxlint/fixtures/tsgolint/prefer-reduce-type-parameter.ts @@ -1,2 +1,4 @@ const numbers = [1, 2, 3]; -const sum = numbers.reduce((acc, val) => acc + val, 0) as number; \ No newline at end of file +const sum = numbers.reduce((acc, val) => acc + val, 0) as number; + +export {}; diff --git a/apps/oxlint/fixtures/tsgolint/promise-function-async.ts b/apps/oxlint/fixtures/tsgolint/promise-function-async.ts index 28831dd1eb811..152e6f1297681 100644 --- a/apps/oxlint/fixtures/tsgolint/promise-function-async.ts +++ b/apps/oxlint/fixtures/tsgolint/promise-function-async.ts @@ -1,4 +1,6 @@ declare function fetch(url: string): Promise; function fetchData(): Promise { return fetch('/api/data').then(res => res.text()); -} \ No newline at end of file +} + +export {}; diff --git a/apps/oxlint/fixtures/tsgolint/require-array-sort-compare.ts b/apps/oxlint/fixtures/tsgolint/require-array-sort-compare.ts index 3835219a7a68a..64d4a30e1ae35 100644 --- a/apps/oxlint/fixtures/tsgolint/require-array-sort-compare.ts +++ b/apps/oxlint/fixtures/tsgolint/require-array-sort-compare.ts @@ -1,2 +1,4 @@ const numbers = [3, 1, 4, 1, 5]; -numbers.sort(); \ No newline at end of file +numbers.sort(); + +export {}; diff --git a/apps/oxlint/fixtures/tsgolint/restrict-template-expressions.ts b/apps/oxlint/fixtures/tsgolint/restrict-template-expressions.ts index e71f014eb1a35..5e57ec6d87eda 100644 --- a/apps/oxlint/fixtures/tsgolint/restrict-template-expressions.ts +++ b/apps/oxlint/fixtures/tsgolint/restrict-template-expressions.ts @@ -1,2 +1,4 @@ declare const obj: object; -const str1 = `Value: ${obj}`; \ No newline at end of file +const str1 = `Value: ${obj}`; + +export {}; diff --git a/apps/oxlint/fixtures/tsgolint/return-await.ts b/apps/oxlint/fixtures/tsgolint/return-await.ts index 1c1181ee743a4..fa724f7db5b4b 100644 --- a/apps/oxlint/fixtures/tsgolint/return-await.ts +++ b/apps/oxlint/fixtures/tsgolint/return-await.ts @@ -2,4 +2,6 @@ declare interface User { id: number; } declare function getUser(): Promise; async function fetchUser(): Promise { return getUser(); -} \ No newline at end of file +} + +export {}; diff --git a/apps/oxlint/fixtures/tsgolint/strict-boolean-expressions.ts b/apps/oxlint/fixtures/tsgolint/strict-boolean-expressions.ts index 2a35004d68e4c..62718863e51d2 100644 --- a/apps/oxlint/fixtures/tsgolint/strict-boolean-expressions.ts +++ b/apps/oxlint/fixtures/tsgolint/strict-boolean-expressions.ts @@ -1,3 +1,5 @@ const str = 'hello'; if (str) { } + +export {} diff --git a/apps/oxlint/fixtures/tsgolint/switch-exhaustiveness-check.ts b/apps/oxlint/fixtures/tsgolint/switch-exhaustiveness-check.ts index 016b0c2c88f02..1a5c52a06a3f6 100644 --- a/apps/oxlint/fixtures/tsgolint/switch-exhaustiveness-check.ts +++ b/apps/oxlint/fixtures/tsgolint/switch-exhaustiveness-check.ts @@ -6,4 +6,6 @@ function handleStatus(status: Status) { case 'approved': return 'Request approved'; } -} \ No newline at end of file +} + +export {}; diff --git a/apps/oxlint/fixtures/tsgolint/tsconfig.json b/apps/oxlint/fixtures/tsgolint/tsconfig.json index 4ac21667f3992..65ab223a06a3d 100644 --- a/apps/oxlint/fixtures/tsgolint/tsconfig.json +++ b/apps/oxlint/fixtures/tsgolint/tsconfig.json @@ -1,8 +1,8 @@ { "compilerOptions": { - "target": "es2016", - "lib": ["ES2024"], - "module": "commonjs", + "target": "es2024", + "lib": ["ES2024", "DOM"], + "module": "es2022", "esModuleInterop": true, "forceConsistentCasingInFileNames": true, "strict": true, diff --git a/apps/oxlint/fixtures/tsgolint_disable_directives/unused.ts b/apps/oxlint/fixtures/tsgolint_disable_directives/unused.ts index fc41bf6cf88ff..2223ce60ea10f 100644 --- a/apps/oxlint/fixtures/tsgolint_disable_directives/unused.ts +++ b/apps/oxlint/fixtures/tsgolint_disable_directives/unused.ts @@ -22,3 +22,5 @@ myPromise /* eslint-disable @typescript-eslint/no-floating-promises */ const x = 1 + 2 /* eslint-enable @typescript-eslint/no-floating-promises */ + +export {} diff --git a/apps/oxlint/src/snapshots/fixtures__tsgolint_--type-aware --silent@oxlint.snap b/apps/oxlint/src/snapshots/fixtures__tsgolint_--type-aware --silent@oxlint.snap index af2d24d57a552..2e794dad414b1 100644 --- a/apps/oxlint/src/snapshots/fixtures__tsgolint_--type-aware --silent@oxlint.snap +++ b/apps/oxlint/src/snapshots/fixtures__tsgolint_--type-aware --silent@oxlint.snap @@ -6,7 +6,7 @@ arguments: --type-aware --silent working directory: fixtures/tsgolint ---------- -Found 0 warnings and 57 errors. +Found 0 warnings and 49 errors. Finished in ms on 44 files using 1 threads. ---------- CLI result: LintFoundErrors diff --git a/apps/oxlint/src/snapshots/fixtures__tsgolint_--type-aware -c config-test.json@oxlint.snap b/apps/oxlint/src/snapshots/fixtures__tsgolint_--type-aware -c config-test.json@oxlint.snap index 9113a5dcbc98e..2dfc8d1942ed5 100644 --- a/apps/oxlint/src/snapshots/fixtures__tsgolint_--type-aware -c config-test.json@oxlint.snap +++ b/apps/oxlint/src/snapshots/fixtures__tsgolint_--type-aware -c config-test.json@oxlint.snap @@ -11,6 +11,7 @@ working directory: fixtures/tsgolint 1 | const promise = new Promise((resolve, _reject) => resolve("value")); 2 | promise; : ^^^^^^^^ + 3 | `---- help: The promise must end with a call to .catch, or end with a call to .then with a rejection handler, or be explicitly marked as ignored with the `void` operator. @@ -18,6 +19,7 @@ working directory: fixtures/tsgolint ,-[non-tsgolint.ts:1:1] 1 | debugger; : ^^^^^^^^^ + 2 | `---- help: Remove the debugger statement diff --git a/apps/oxlint/src/snapshots/fixtures__tsgolint_--type-aware@oxlint.snap b/apps/oxlint/src/snapshots/fixtures__tsgolint_--type-aware@oxlint.snap index e586845d96988..61dc75e1feafa 100644 --- a/apps/oxlint/src/snapshots/fixtures__tsgolint_--type-aware@oxlint.snap +++ b/apps/oxlint/src/snapshots/fixtures__tsgolint_--type-aware@oxlint.snap @@ -10,6 +10,7 @@ working directory: fixtures/tsgolint ,-[await-thenable.ts:1:1] 1 | await 12; : ^^^^^^^^ + 2 | `---- x typescript-eslint(no-array-delete): Using the `delete` operator with an array expression is unsafe. @@ -30,6 +31,7 @@ working directory: fixtures/tsgolint 1 | declare function bar(): void; 2 | const foo = () => void bar(); : ^^^^^^^^^^ + 3 | `---- x typescript-eslint(no-confusing-void-expression): Placing a void expression inside another expression is forbidden. Move it to its own statement instead. @@ -37,6 +39,7 @@ working directory: fixtures/tsgolint 1 | declare function bar(): void; 2 | const foo = () => void bar(); : ^^^^^ + 3 | `---- x typescript-eslint(no-deprecated): `getVersion` is deprecated. Use apiV2 instead. @@ -50,6 +53,7 @@ working directory: fixtures/tsgolint ,-[no-duplicate-type-constituents.ts:1:17] 1 | type T1 = 'A' | 'A'; : ^^^ + 2 | `---- x typescript-eslint(no-confusing-void-expression): Returning a void expression from an arrow function shorthand is forbidden. Please add braces to the arrow function. @@ -64,6 +68,7 @@ working directory: fixtures/tsgolint 1 | const promise = new Promise((resolve, _reject) => resolve("value")); 2 | promise; : ^^^^^^^^ + 3 | `---- help: The promise must end with a call to .catch, or end with a call to .then with a rejection handler, or be explicitly marked as ignored with the `void` operator. @@ -76,39 +81,18 @@ working directory: fixtures/tsgolint 3 | console.log(arr[i]); `---- - x typescript-eslint(no-unsafe-call): Unsafe call of a(n) `any` typed value. - ,-[no-for-in-array.ts:3:3] - 2 | for (const i in arr) { - 3 | console.log(arr[i]); - : ^^^^^^^^^^^ - 4 | } - `---- - - x typescript-eslint(no-unsafe-member-access): Unsafe member access .log on an `any` value. - ,-[no-for-in-array.ts:3:11] - 2 | for (const i in arr) { - 3 | console.log(arr[i]); - : ^^^ - 4 | } - `---- - - x typescript-eslint(no-unsafe-call): Unsafe call of a(n) `any` typed value. - ,-[no-implied-eval.ts:1:1] - 1 | setTimeout('alert("Hi!");', 100); - : ^^^^^^^^^^ - `---- - x typescript-eslint(no-implied-eval): Implied eval. Consider passing a function. ,-[no-implied-eval.ts:1:12] 1 | setTimeout('alert("Hi!");', 100); : ^^^^^^^^^^^^^^^ `---- - x typescript-eslint(no-meaningless-void-operator): void operator shouldn't be used on undefined; it should convey that a return value is being ignored + x typescript-eslint(no-meaningless-void-operator): void operator shouldn't be used on void; it should convey that a return value is being ignored ,-[no-meaningless-void-operator.ts:4:1] 3 | } 4 | void foo(); : ^^^^^^^^^^ + 5 | `---- x typescript-eslint(no-confusing-void-expression): Placing a void expression inside another expression is forbidden. Move it to its own statement instead. @@ -116,6 +100,7 @@ working directory: fixtures/tsgolint 3 | } 4 | void foo(); : ^^^^^ + 5 | `---- x typescript-eslint(no-misused-spread): Using the spread operator on Promise in an object can cause unexpected behavior. Did you forget to await the promise? @@ -159,6 +144,7 @@ working directory: fixtures/tsgolint 1 | const str: string = 'hello'; 2 | const redundant = str as string; : ^^^^^^^^^^^^^ + 3 | `---- x typescript-eslint(no-unsafe-argument): Unsafe argument of type any assigned to a parameter of type string. @@ -166,6 +152,7 @@ working directory: fixtures/tsgolint 2 | function takesString(str: string): void {} 3 | takesString(anyValue); : ^^^^^^^^ + 4 | `---- x typescript-eslint(no-unsafe-assignment): Unsafe assignment of an any value. @@ -173,6 +160,7 @@ working directory: fixtures/tsgolint 1 | declare const anyValue: any; 2 | const str: string = anyValue; : ^^^^^^^^^^^^^^^^^^^^^^ + 3 | `---- x typescript-eslint(no-unsafe-call): Unsafe call of a(n) `any` typed value. @@ -180,21 +168,23 @@ working directory: fixtures/tsgolint 1 | declare const anyValue: any; 2 | anyValue(); : ^^^^^^^^ + 3 | `---- - x typescript-eslint(no-mixed-enums): Mixing number and string enums can be confusing. - ,-[no-unsafe-enum-comparison.ts:2:10] - 1 | enum Status { - 2 | Open = 'open', - : ^^^^^^ - 3 | Closed = 'closed', - `---- + x typescript-eslint(no-unsafe-enum-comparison): The two values in this comparison do not have a shared enum type. + ,-[no-unsafe-enum-comparison.ts:9:20] + 8 | } + 9 | const comparison = Status.Open === Color.Red; + : ^^^^^^^^^^^^^^^^^^^^^^^^^ + 10 | + `---- x typescript-eslint(no-unsafe-member-access): Unsafe member access .foo on an `any` value. ,-[no-unsafe-member-access.ts:2:10] 1 | declare const anyValue: any; 2 | anyValue.foo; : ^^^ + 3 | `---- x typescript-eslint(no-unsafe-return): Unsafe return of a value of type `any`. @@ -210,6 +200,7 @@ working directory: fixtures/tsgolint 1 | declare const value: unknown; 2 | const str = value as any; : ^^^^^^^^^^^^^^^^^^ + 3 | `---- x typescript-eslint(no-unsafe-type-assertion): Unsafe assertion to `any` detected: consider using a more specific type to ensure safety. @@ -217,26 +208,30 @@ working directory: fixtures/tsgolint 1 | declare const value: unknown; 2 | const str = value as any; : ^^^^^^^^^^^^ + 3 | `---- - x typescript-eslint(no-unsafe-unary-minus): Argument of unary negation should be assignable to number | bigint but is unknown instead. - ,-[no-unsafe-unary-minus.ts:2:17] - 1 | declare const value: any; - 2 | const result1 = -value; - : ^^^^^^ + x typescript-eslint(no-unsafe-type-assertion): Unsafe type assertion: type 'string' is more narrow than the original type. + ,-[non-nullable-type-assertion-style.ts:2:17] + 1 | declare const value: string | null; + 2 | const result1 = value as string; + : ^^^^^^^^^^^^^^^ + 3 | `---- - x typescript-eslint(no-unsafe-type-assertion): Unsafe type assertion: type 'string' is more narrow than the original type. + x typescript-eslint(non-nullable-type-assertion-style): Use a ! assertion to more succinctly remove null and undefined from the type. ,-[non-nullable-type-assertion-style.ts:2:17] 1 | declare const value: string | null; 2 | const result1 = value as string; : ^^^^^^^^^^^^^^^ + 3 | `---- x ]8;;https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-debugger.html\eslint(no-debugger)]8;;\: `debugger` statement is not allowed ,-[non-tsgolint.ts:1:1] 1 | debugger; : ^^^^^^^^^ + 2 | `---- help: Remove the debugger statement @@ -244,6 +239,7 @@ working directory: fixtures/tsgolint ,-[only-throw-error.ts:1:7] 1 | throw 'error'; : ^^^^^^^ + 2 | `---- x typescript-eslint(prefer-includes): Use 'includes()' method instead. @@ -288,6 +284,7 @@ working directory: fixtures/tsgolint 1 | const numbers = [1, 2, 3]; 2 | const sum = numbers.reduce((acc, val) => acc + val, 0) as number; : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + 3 | `---- x typescript-eslint(prefer-return-this-type): Use `this` type instead. @@ -304,29 +301,14 @@ working directory: fixtures/tsgolint 2 | ,-> function fetchData(): Promise { 3 | | return fetch('/api/data').then(res => res.text()); 4 | `-> } + 5 | `---- - x typescript-eslint(no-unsafe-call): Unsafe call of a(n) `any` typed value. - ,-[promise-function-async.ts:3:41] - 2 | function fetchData(): Promise { - 3 | return fetch('/api/data').then(res => res.text()); - : ^^^^^^^^ - 4 | } - `---- - - x typescript-eslint(no-unsafe-return): Unsafe return of a value of type `any`. - ,-[promise-function-async.ts:3:41] - 2 | function fetchData(): Promise { - 3 | return fetch('/api/data').then(res => res.text()); - : ^^^^^^^^^^ - 4 | } - `---- - - x typescript-eslint(no-unsafe-member-access): Unsafe member access .text on an `error` typed value. - ,-[promise-function-async.ts:3:45] + x typescript-eslint(promise-function-async): Functions that return promises must be async. + ,-[promise-function-async.ts:3:34] 2 | function fetchData(): Promise { 3 | return fetch('/api/data').then(res => res.text()); - : ^^^^ + : ^^^^^^^^^^^^^^^^^ 4 | } `---- @@ -343,14 +325,7 @@ working directory: fixtures/tsgolint 1 | const numbers = [3, 1, 4, 1, 5]; 2 | numbers.sort(); : ^^^^^^^^^^^^^^ - `---- - - x typescript-eslint(no-unsafe-return): Unsafe return of a value of type `Promise`. - ,-[require-await.ts:3:3] - 2 | async function fetchData() { - 3 | return fetch('/api/data'); - : ^^^^^^^^^^^^^^^^^^^^^^^^^^ - 4 | } + 3 | `---- x typescript-eslint(no-unsafe-assignment): Unsafe assignment of an any value. @@ -370,6 +345,7 @@ working directory: fixtures/tsgolint 1 | declare const obj: object; 2 | const str1 = `Value: ${obj}`; : ^^^ + 3 | `---- x typescript-eslint(restrict-template-expressions): Invalid type "object" of template literal expression. @@ -377,6 +353,7 @@ working directory: fixtures/tsgolint 1 | declare const obj: object; 2 | const str1 = `Value: ${obj}`; : ^^^ + 3 | `---- x typescript-eslint(switch-exhaustiveness-check): Switch is not exhaustive @@ -387,22 +364,6 @@ working directory: fixtures/tsgolint 4 | case 'pending': `---- - x typescript-eslint(no-unsafe-enum-comparison): The case statement does not have a shared enum type with the switch predicate. - ,-[switch-exhaustiveness-check.ts:4:5] - 3 | switch (status) { - 4 | ,-> case 'pending': - 5 | `-> return 'Waiting for approval'; - 6 | case 'approved': - `---- - - x typescript-eslint(no-unsafe-enum-comparison): The case statement does not have a shared enum type with the switch predicate. - ,-[switch-exhaustiveness-check.ts:6:5] - 5 | return 'Waiting for approval'; - 6 | ,-> case 'approved': - 7 | `-> return 'Request approved'; - 8 | } - `---- - x ]8;;https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-debugger.html\eslint(no-debugger)]8;;\: `debugger` statement is not allowed ,-[test.svelte:2:2] 1 |