Skip to content

Commit f294ddd

Browse files
committed
fix tests
1 parent 8b3c6ae commit f294ddd

29 files changed

+386
-454
lines changed

eslint.config.mjs

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export default [
1212
"tests/fixtures/**/*.svelte",
1313
"tests/fixtures/**/*.js",
1414
"tests/fixtures/**/*.ts",
15+
"!tests/fixtures/integrations/**/*-setup.ts",
1516
"explorer/dist",
1617
"explorer/node_modules",
1718
"explorer-v2/build",

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
"env-cmd": "^10.1.0",
8484
"esbuild": "^0.24.0",
8585
"esbuild-register": "^3.6.0",
86-
"eslint": "~9.15.0",
86+
"eslint": "~9.16.0",
8787
"eslint-config-prettier": "^9.1.0",
8888
"eslint-plugin-eslint-comments": "^3.2.0",
8989
"eslint-plugin-jsdoc": "^50.6.0",
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
1-
/* eslint eslint-comments/require-description: 0, @typescript-eslint/explicit-module-boundary-types: 0 */
21
import { generateParserOptions } from "../../../src/parser/test-utils";
32
import * as ts from "@typescript-eslint/parser";
3+
import globals from "globals";
4+
import * as parser from "../../../../src";
5+
import type { Linter } from "eslint";
46

5-
export function getConfig() {
7+
export function getConfig(): Linter.Config {
68
return {
7-
parser: "svelte-eslint-parser",
8-
parserOptions: generateParserOptions({ parser: { ts } }),
9-
env: {
10-
browser: true,
11-
es2021: true,
9+
languageOptions: {
10+
parser,
11+
parserOptions: generateParserOptions({ parser: { ts } }),
12+
globals: {
13+
...globals.browser,
14+
...globals.es2021,
15+
},
1216
},
1317
};
1418
}
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
1-
/* eslint eslint-comments/require-description: 0, @typescript-eslint/explicit-module-boundary-types: 0 */
21
import { generateParserOptions } from "../../../src/parser/test-utils";
3-
import * as parser from "@typescript-eslint/parser";
2+
import * as ts from "@typescript-eslint/parser";
3+
import globals from "globals";
4+
import * as parser from "../../../../src";
5+
import type { Linter } from "eslint";
46

5-
export function getConfig() {
7+
export function getConfig(): Linter.Config {
68
return {
7-
parser: "svelte-eslint-parser",
8-
parserOptions: generateParserOptions({ parser }),
9-
env: {
10-
browser: true,
11-
es2021: true,
9+
languageOptions: {
10+
parser,
11+
parserOptions: generateParserOptions({ parser: ts }),
12+
globals: {
13+
...globals.browser,
14+
...globals.es2021,
15+
},
1216
},
1317
};
1418
}
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
1-
/* eslint eslint-comments/require-description: 0, @typescript-eslint/explicit-module-boundary-types: 0 */
21
import type { Linter } from "eslint";
32
import { generateParserOptions } from "../../../src/parser/test-utils";
4-
import { rules } from "eslint-plugin-svelte";
5-
export function setupLinter(linter: Linter) {
6-
linter.defineRule(
7-
"svelte/no-immutable-reactive-statements",
8-
rules["no-immutable-reactive-statements"] as never,
9-
);
10-
}
3+
import * as svelte from "eslint-plugin-svelte";
4+
import globals from "globals";
5+
import * as parser from "../../../../src";
116

12-
export function getConfig() {
7+
export function getConfig(): Linter.Config {
138
return {
14-
parser: "svelte-eslint-parser",
15-
parserOptions: generateParserOptions(),
9+
plugins: {
10+
svelte: svelte as any,
11+
},
12+
languageOptions: {
13+
parser,
14+
parserOptions: generateParserOptions(),
15+
globals: {
16+
...globals.browser,
17+
...globals.es2021,
18+
},
19+
},
1620
rules: {
1721
"svelte/no-immutable-reactive-statements": "error",
1822
},
19-
env: {
20-
browser: true,
21-
es2021: true,
22-
},
2323
};
2424
}
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,29 @@
1-
/* eslint eslint-comments/require-description: 0, @typescript-eslint/explicit-module-boundary-types: 0 */
21
import type { Linter } from "eslint";
32
import { generateParserOptions } from "../../../src/parser/test-utils";
43
import { rules } from "@typescript-eslint/eslint-plugin";
5-
export function setupLinter(linter: Linter) {
6-
linter.defineRule(
7-
"@typescript-eslint/no-unused-vars",
8-
rules["no-unused-vars"] as never,
9-
);
10-
}
4+
import * as parser from "../../../../src";
5+
import globals from "globals";
116

12-
export function getConfig() {
7+
export function getConfig(): Linter.Config {
138
return {
14-
parser: "svelte-eslint-parser",
15-
parserOptions: {
16-
...generateParserOptions(),
17-
svelteFeatures: { runes: true },
9+
plugins: {
10+
"@typescript-eslint": {
11+
rules: rules as any,
12+
},
13+
},
14+
languageOptions: {
15+
parser,
16+
parserOptions: {
17+
...generateParserOptions(),
18+
svelteFeatures: { runes: true },
19+
},
20+
globals: {
21+
...globals.browser,
22+
...globals.es2021,
23+
},
1824
},
1925
rules: {
2026
"@typescript-eslint/no-unused-vars": "error",
2127
},
22-
env: {
23-
browser: true,
24-
es2021: true,
25-
},
2628
};
2729
}
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,26 @@
1-
/* eslint eslint-comments/require-description: 0, @typescript-eslint/explicit-module-boundary-types: 0 */
21
import type { Linter } from "eslint";
32
import { generateParserOptions } from "../../../src/parser/test-utils";
43
import { rules } from "@typescript-eslint/eslint-plugin";
5-
export function setupLinter(linter: Linter) {
6-
linter.defineRule(
7-
"@typescript-eslint/no-unsafe-argument",
8-
rules["no-unsafe-argument"] as never,
9-
);
10-
linter.defineRule(
11-
"@typescript-eslint/no-unsafe-assignment",
12-
rules["no-unsafe-assignment"] as never,
13-
);
14-
linter.defineRule(
15-
"@typescript-eslint/no-unsafe-call",
16-
rules["no-unsafe-call"] as never,
17-
);
18-
linter.defineRule(
19-
"@typescript-eslint/no-unsafe-member-access",
20-
rules["no-unsafe-member-access"] as never,
21-
);
22-
linter.defineRule(
23-
"@typescript-eslint/no-unsafe-return",
24-
rules["no-unsafe-return"] as never,
25-
);
26-
}
4+
import * as parser from "../../../../src";
5+
import globals from "globals";
276

28-
export function getConfig() {
7+
export function getConfig(): Linter.Config {
298
return {
30-
parser: "svelte-eslint-parser",
31-
parserOptions: {
32-
...generateParserOptions(),
33-
svelteFeatures: { runes: true },
9+
plugins: {
10+
"@typescript-eslint": {
11+
rules: rules as any,
12+
},
13+
},
14+
languageOptions: {
15+
parser,
16+
parserOptions: {
17+
...generateParserOptions(),
18+
svelteFeatures: { runes: true },
19+
},
20+
globals: {
21+
...globals.browser,
22+
...globals.es2021,
23+
},
3424
},
3525
rules: {
3626
"@typescript-eslint/no-unsafe-argument": "error",
@@ -39,9 +29,5 @@ export function getConfig() {
3929
"@typescript-eslint/no-unsafe-member-access": "error",
4030
"@typescript-eslint/no-unsafe-return": "error",
4131
},
42-
env: {
43-
browser: true,
44-
es2021: true,
45-
},
4632
};
4733
}
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,26 @@
1-
/* eslint eslint-comments/require-description: 0, @typescript-eslint/explicit-module-boundary-types: 0 */
21
import type { Linter } from "eslint";
32
import { generateParserOptions } from "../../../src/parser/test-utils";
43
import { rules } from "@typescript-eslint/eslint-plugin";
5-
export function setupLinter(linter: Linter) {
6-
linter.defineRule(
7-
"@typescript-eslint/no-unsafe-argument",
8-
rules["no-unsafe-argument"] as never,
9-
);
10-
linter.defineRule(
11-
"@typescript-eslint/no-unsafe-assignment",
12-
rules["no-unsafe-assignment"] as never,
13-
);
14-
linter.defineRule(
15-
"@typescript-eslint/no-unsafe-call",
16-
rules["no-unsafe-call"] as never,
17-
);
18-
linter.defineRule(
19-
"@typescript-eslint/no-unsafe-member-access",
20-
rules["no-unsafe-member-access"] as never,
21-
);
22-
linter.defineRule(
23-
"@typescript-eslint/no-unsafe-return",
24-
rules["no-unsafe-return"] as never,
25-
);
26-
}
4+
import * as parser from "../../../../src";
5+
import globals from "globals";
276

28-
export function getConfig() {
7+
export function getConfig(): Linter.Config {
298
return {
30-
parser: "svelte-eslint-parser",
31-
parserOptions: {
32-
...generateParserOptions(),
33-
svelteFeatures: { runes: true },
9+
plugins: {
10+
"@typescript-eslint": {
11+
rules: rules as any,
12+
},
13+
},
14+
languageOptions: {
15+
parser,
16+
parserOptions: {
17+
...generateParserOptions(),
18+
svelteFeatures: { runes: true },
19+
},
20+
globals: {
21+
...globals.browser,
22+
...globals.es2021,
23+
},
3424
},
3525
rules: {
3626
"@typescript-eslint/no-unsafe-argument": "error",
@@ -39,9 +29,5 @@ export function getConfig() {
3929
"@typescript-eslint/no-unsafe-member-access": "error",
4030
"@typescript-eslint/no-unsafe-return": "error",
4131
},
42-
env: {
43-
browser: true,
44-
es2021: true,
45-
},
4632
};
4733
}
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,26 @@
1-
/* eslint eslint-comments/require-description: 0, @typescript-eslint/explicit-module-boundary-types: 0 */
21
import type { Linter } from "eslint";
32
import { generateParserOptions } from "../../../src/parser/test-utils";
43
import { rules } from "@typescript-eslint/eslint-plugin";
5-
export function setupLinter(linter: Linter) {
6-
linter.defineRule(
7-
"@typescript-eslint/no-unsafe-argument",
8-
rules["no-unsafe-argument"] as never,
9-
);
10-
linter.defineRule(
11-
"@typescript-eslint/no-unsafe-assignment",
12-
rules["no-unsafe-assignment"] as never,
13-
);
14-
linter.defineRule(
15-
"@typescript-eslint/no-unsafe-call",
16-
rules["no-unsafe-call"] as never,
17-
);
18-
linter.defineRule(
19-
"@typescript-eslint/no-unsafe-member-access",
20-
rules["no-unsafe-member-access"] as never,
21-
);
22-
linter.defineRule(
23-
"@typescript-eslint/no-unsafe-return",
24-
rules["no-unsafe-return"] as never,
25-
);
26-
}
4+
import * as parser from "../../../../src";
5+
import globals from "globals";
276

28-
export function getConfig() {
7+
export function getConfig(): Linter.Config {
298
return {
30-
parser: "svelte-eslint-parser",
31-
parserOptions: {
32-
...generateParserOptions(),
33-
svelteFeatures: { runes: true },
9+
plugins: {
10+
"@typescript-eslint": {
11+
rules: rules as any,
12+
},
13+
},
14+
languageOptions: {
15+
parser,
16+
parserOptions: {
17+
...generateParserOptions(),
18+
svelteFeatures: { runes: true },
19+
},
20+
globals: {
21+
...globals.browser,
22+
...globals.es2021,
23+
},
3424
},
3525
rules: {
3626
"@typescript-eslint/no-unsafe-argument": "error",
@@ -39,9 +29,5 @@ export function getConfig() {
3929
"@typescript-eslint/no-unsafe-member-access": "error",
4030
"@typescript-eslint/no-unsafe-return": "error",
4131
},
42-
env: {
43-
browser: true,
44-
es2021: true,
45-
},
4632
};
4733
}

0 commit comments

Comments
 (0)