Skip to content

Commit 9ec9233

Browse files
committed
chore: Update TS rule tester
1 parent e91c3e6 commit 9ec9233

File tree

4 files changed

+8
-10
lines changed

4 files changed

+8
-10
lines changed

bun.lockb

2.75 KB
Binary file not shown.

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"eslint": ">=8.56.0"
4242
},
4343
"dependencies": {
44-
"@typescript-eslint/utils": "^8.11.0",
44+
"@typescript-eslint/utils": "^8.12.1",
4545
"isomorphic-resolve": "^1.0.0",
4646
"natural-compare": "^1.4.0"
4747
},
@@ -51,7 +51,7 @@
5151
"@types/dedent": "^0.7.0",
5252
"@types/estree": "^1.0.6",
5353
"@types/natural-compare": "^1.4.1",
54-
"@typescript-eslint/rule-tester": "^8.11.0",
54+
"@typescript-eslint/rule-tester": "^8.12.1",
5555
"bun-types": "^1.0.1",
5656
"dedent": "^0.7.0",
5757
"eslint": "^9.13.0",

src/__tests__/type-properties.spec.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,10 @@ ruleTester.run("type-properties", rule, {
126126
// Nested
127127
{
128128
code: "interface A {b:string; a:{b:string; a:number}}",
129-
output: "interface A {a:{b:string; a:number}; b:string}",
130-
// Rule tester will not run multiple fix iterations, but as long as we
131-
// have two errors, we know the nested rule was caught.
129+
output: [
130+
"interface A {a:{b:string; a:number}; b:string}",
131+
"interface A {a:{a:number; b:string}; b:string}",
132+
],
132133
errors: [{ messageId: "unsorted" }, { messageId: "unsorted" }],
133134
},
134135

src/test-utils.ts

+2-5
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,7 @@ export function createRuleTester(config?: Linter.Config) {
4545
}
4646

4747
export function createTsRuleTester(config?: Linter.Config) {
48-
// TSRuleTester is broken
49-
// https://github.com/typescript-eslint/typescript-eslint/issues/9676
50-
// https://github.com/typescript-eslint/typescript-eslint/issues/10191
51-
return new RuleTester({
48+
return new TSRuleTester({
5249
...config,
5350
languageOptions: {
5451
...config?.languageOptions,
@@ -59,5 +56,5 @@ export function createTsRuleTester(config?: Linter.Config) {
5956
...config?.languageOptions?.parserOptions,
6057
},
6158
},
62-
}) as unknown as TSRuleTester
59+
})
6360
}

0 commit comments

Comments
 (0)