Skip to content

Commit 770a516

Browse files
authored
Upgrade ESLint from v9 to v10 (#226)
1 parent 50bd677 commit 770a516

File tree

14 files changed

+640
-833
lines changed

14 files changed

+640
-833
lines changed

.github/workflows/test.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,13 @@ jobs:
1414
node-version: [20, 22]
1515
ts-version: ["5.0", "5.4", "5.8"]
1616
ts-eslint-version: [8]
17-
eslint-version: [8, 9]
17+
eslint-version: [8, 9, 10]
1818
flat-config: ["true", ""]
1919
exclude:
2020
- eslint-version: 8
2121
flat-config: "true"
22+
- eslint-version: 10
23+
flat-config: ""
2224

2325
steps:
2426
- uses: actions/checkout@v6

package-lock.json

Lines changed: 191 additions & 363 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,33 +34,35 @@
3434
},
3535
"license": "MIT",
3636
"dependencies": {
37-
"@typescript-eslint/utils": "^8.4.0",
37+
"@typescript-eslint/utils": "^8.57.0",
3838
"minimatch": "^10.0.1",
3939
"tsutils": "^3.21.0"
4040
},
4141
"devDependencies": {
4242
"@babel/core": "^7.14.6",
4343
"@babel/preset-env": "^7.14.7",
4444
"@babel/preset-typescript": "^7.14.5",
45+
"@eslint/js": "^10.0.1",
4546
"@fixture-package-third-party/has-sub-module": "file:src/__tests__/fixtures/packages/third-party/has-sub-module",
4647
"@fixture-package-third-party/missing-entrypoint": "file:src/__tests__/fixtures/packages/third-party/missing-entrypoint",
4748
"@fixture-package-third-party/with-exports-field": "file:src/__tests__/fixtures/packages/third-party/with-exports-field",
4849
"@fixture-package-workspace/has-sub-module": "*",
4950
"@fixture-package-workspace/missing-entrypoint": "*",
5051
"@fixture-package-workspace/with-exports-field": "*",
5152
"@types/node": "24.0.1",
52-
"@typescript-eslint/eslint-plugin": "^8.4.0",
53-
"@typescript-eslint/parser": "^8.4.0",
54-
"@typescript-eslint/typescript-estree": "^8.4.0",
53+
"@typescript-eslint/eslint-plugin": "^8.57.0",
54+
"@typescript-eslint/parser": "^8.57.0",
55+
"@typescript-eslint/typescript-estree": "^8.57.0",
56+
"@typescript-eslint/utils": "^8.57.0",
5557
"@vitest/expect": "^4.0.4",
56-
"eslint": "^9.28.0",
58+
"eslint": "^10.0.3",
5759
"eslint-plugin-local-rules": "^3.0.2",
5860
"prettier": "^3.2.5",
5961
"typescript": "^5.1.6",
60-
"typescript-eslint": "^8.4.0",
62+
"typescript-eslint": "^8.57.0",
6163
"vitest": "^4.0.5"
6264
},
6365
"workspaces": [
6466
"src/__tests__/fixtures/packages/workspaces/*"
6567
]
66-
}
68+
}

src/__tests__/classes.ts

Lines changed: 46 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -10,59 +10,55 @@ describe("class declaration", () => {
1010
it("Cannot import from sub directory", async () => {
1111
const result = await tester.lintFile("src/class/barUser.ts");
1212
expect(result).toMatchInlineSnapshot(`
13-
Array [
14-
Object {
15-
"column": 10,
16-
"endColumn": 26,
17-
"endLine": 1,
18-
"line": 1,
19-
"message": "Cannot import a package-private export 'barAccessPackage'",
20-
"messageId": "package",
21-
"nodeType": "ImportSpecifier",
22-
"ruleId": "import-access/jsdoc",
23-
"severity": 2,
24-
},
25-
Object {
26-
"column": 28,
27-
"endColumn": 38,
28-
"endLine": 1,
29-
"line": 1,
30-
"message": "Cannot import a package-private export 'barPackage'",
31-
"messageId": "package",
32-
"nodeType": "ImportSpecifier",
33-
"ruleId": "import-access/jsdoc",
34-
"severity": 2,
35-
},
36-
Object {
37-
"column": 40,
38-
"endColumn": 61,
39-
"endLine": 1,
40-
"line": 1,
41-
"message": "Cannot import a package-private export 'barPackage'",
42-
"messageId": "package",
43-
"nodeType": "ImportSpecifier",
44-
"ruleId": "import-access/jsdoc",
45-
"severity": 2,
46-
},
47-
]
48-
`);
13+
Array [
14+
Object {
15+
"column": 10,
16+
"endColumn": 26,
17+
"endLine": 1,
18+
"line": 1,
19+
"message": "Cannot import a package-private export 'barAccessPackage'",
20+
"messageId": "package",
21+
"ruleId": "import-access/jsdoc",
22+
"severity": 2,
23+
},
24+
Object {
25+
"column": 28,
26+
"endColumn": 38,
27+
"endLine": 1,
28+
"line": 1,
29+
"message": "Cannot import a package-private export 'barPackage'",
30+
"messageId": "package",
31+
"ruleId": "import-access/jsdoc",
32+
"severity": 2,
33+
},
34+
Object {
35+
"column": 40,
36+
"endColumn": 61,
37+
"endLine": 1,
38+
"line": 1,
39+
"message": "Cannot import a package-private export 'barPackage'",
40+
"messageId": "package",
41+
"ruleId": "import-access/jsdoc",
42+
"severity": 2,
43+
},
44+
]
45+
`);
4946
});
5047
it("Cannot default-import package-private function", async () => {
5148
const result = await tester.lintFile("src/class/bazUser.ts");
5249
expect(result).toMatchInlineSnapshot(`
53-
Array [
54-
Object {
55-
"column": 8,
56-
"endColumn": 18,
57-
"endLine": 1,
58-
"line": 1,
59-
"message": "Cannot import a package-private export 'default'",
60-
"messageId": "package",
61-
"nodeType": "ImportDefaultSpecifier",
62-
"ruleId": "import-access/jsdoc",
63-
"severity": 2,
64-
},
65-
]
66-
`);
50+
Array [
51+
Object {
52+
"column": 8,
53+
"endColumn": 18,
54+
"endLine": 1,
55+
"line": 1,
56+
"message": "Cannot import a package-private export 'default'",
57+
"messageId": "package",
58+
"ruleId": "import-access/jsdoc",
59+
"severity": 2,
60+
},
61+
]
62+
`);
6763
});
6864
});

src/__tests__/default-export.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ describe("default export", () => {
1414
"line": 1,
1515
"message": "Cannot import a package-private export 'default'",
1616
"messageId": "package",
17-
"nodeType": "ImportDefaultSpecifier",
1817
"ruleId": "import-access/jsdoc",
1918
"severity": 2,
2019
},
@@ -25,7 +24,6 @@ describe("default export", () => {
2524
"line": 4,
2625
"message": "Cannot import a package-private export 'default'",
2726
"messageId": "package",
28-
"nodeType": "ImportSpecifier",
2927
"ruleId": "import-access/jsdoc",
3028
"severity": 2,
3129
},
@@ -47,7 +45,6 @@ describe("default export", () => {
4745
"line": 1,
4846
"message": "Cannot import a package-private export 'default'",
4947
"messageId": "package",
50-
"nodeType": "ImportDefaultSpecifier",
5148
"ruleId": "import-access/jsdoc",
5249
"severity": 2,
5350
},
@@ -58,7 +55,6 @@ describe("default export", () => {
5855
"line": 2,
5956
"message": "Cannot import a package-private export 'default'",
6057
"messageId": "package",
61-
"nodeType": "ImportDefaultSpecifier",
6258
"ruleId": "import-access/jsdoc",
6359
"severity": 2,
6460
},
@@ -69,7 +65,6 @@ describe("default export", () => {
6965
"line": 4,
7066
"message": "Cannot import a package-private export 'default'",
7167
"messageId": "package",
72-
"nodeType": "ImportSpecifier",
7368
"ruleId": "import-access/jsdoc",
7469
"severity": 2,
7570
},
@@ -91,7 +86,6 @@ describe("default export", () => {
9186
"line": 1,
9287
"message": "Cannot import a package-private export 'default'",
9388
"messageId": "package",
94-
"nodeType": "ImportDefaultSpecifier",
9589
"ruleId": "import-access/jsdoc",
9690
"severity": 2,
9791
},
@@ -102,7 +96,6 @@ describe("default export", () => {
10296
"line": 2,
10397
"message": "Cannot import a private export 'default'",
10498
"messageId": "private",
105-
"nodeType": "ImportDefaultSpecifier",
10699
"ruleId": "import-access/jsdoc",
107100
"severity": 2,
108101
},
@@ -113,7 +106,6 @@ describe("default export", () => {
113106
"line": 4,
114107
"message": "Cannot import a package-private export 'default'",
115108
"messageId": "package",
116-
"nodeType": "ImportSpecifier",
117109
"ruleId": "import-access/jsdoc",
118110
"severity": 2,
119111
},

src/__tests__/directory-structure.ts

Lines changed: 26 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,19 @@ describe("directory structure", () => {
88
"src/directory-structure/subsubUser.ts",
99
);
1010
expect(result).toMatchInlineSnapshot(`
11-
Array [
12-
Object {
13-
"column": 10,
14-
"endColumn": 19,
15-
"endLine": 1,
16-
"line": 1,
17-
"message": "Cannot import a package-private export 'subsubVar'",
18-
"messageId": "package",
19-
"nodeType": "ImportSpecifier",
20-
"ruleId": "import-access/jsdoc",
21-
"severity": 2,
22-
},
23-
]
24-
`);
11+
Array [
12+
Object {
13+
"column": 10,
14+
"endColumn": 19,
15+
"endLine": 1,
16+
"line": 1,
17+
"message": "Cannot import a package-private export 'subsubVar'",
18+
"messageId": "package",
19+
"ruleId": "import-access/jsdoc",
20+
"severity": 2,
21+
},
22+
]
23+
`);
2524
});
2625
it("Can import from sub/index.ts", async () => {
2726
const result = await tester.lintFile(
@@ -40,19 +39,18 @@ Array [
4039
"src/directory-structure/sub/sub3/siblingUser.ts",
4140
);
4241
expect(result).toMatchInlineSnapshot(`
43-
Array [
44-
Object {
45-
"column": 10,
46-
"endColumn": 19,
47-
"endLine": 1,
48-
"line": 1,
49-
"message": "Cannot import a package-private export 'subsubVar'",
50-
"messageId": "package",
51-
"nodeType": "ImportSpecifier",
52-
"ruleId": "import-access/jsdoc",
53-
"severity": 2,
54-
},
55-
]
56-
`);
42+
Array [
43+
Object {
44+
"column": 10,
45+
"endColumn": 19,
46+
"endLine": 1,
47+
"line": 1,
48+
"message": "Cannot import a package-private export 'subsubVar'",
49+
"messageId": "package",
50+
"ruleId": "import-access/jsdoc",
51+
"severity": 2,
52+
},
53+
]
54+
`);
5755
});
5856
});

src/__tests__/exclude-patterns.ts

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,19 @@ it("Importing from generated package is disallowed by default", async () => {
1212
},
1313
);
1414
expect(result).toMatchInlineSnapshot(`
15-
Array [
16-
Object {
17-
"column": 10,
18-
"endColumn": 19,
19-
"endLine": 1,
20-
"line": 1,
21-
"message": "Cannot import a package-private export 'someValue'",
22-
"messageId": "package",
23-
"nodeType": "ImportSpecifier",
24-
"ruleId": "import-access/jsdoc",
25-
"severity": 2,
26-
},
27-
]
28-
`);
15+
Array [
16+
Object {
17+
"column": 10,
18+
"endColumn": 19,
19+
"endLine": 1,
20+
"line": 1,
21+
"message": "Cannot import a package-private export 'someValue'",
22+
"messageId": "package",
23+
"ruleId": "import-access/jsdoc",
24+
"severity": 2,
25+
},
26+
]
27+
`);
2928
});
3029

3130
it("Importing from generated package is allowed with excludeSourcePatterns targeting the file path (relative path)", async () => {

0 commit comments

Comments
 (0)