Skip to content

Commit b23bed1

Browse files
authored
chore: update eslint to 10.x [AR-48952] (#186)
1 parent 3ef4760 commit b23bed1

8 files changed

Lines changed: 373 additions & 381 deletions

File tree

.changeset/loud-worms-film.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@drivenets/eslint-plugin-design-system': patch
3+
---
4+
5+
Add support for ESLint 10

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@
3838
"@commitlint/types": "^20.4.0",
3939
"@drivenets/commitlint-plugin-design-system": "workspace:*",
4040
"@eslint/core": "^1.1.0",
41-
"@eslint/js": "^9.39.3",
41+
"@eslint/js": "^10.0.1",
4242
"@types/node": "^25.3.0",
4343
"@vitest/eslint-plugin": "^1.6.9",
4444
"cspell": "^9.6.4",
45-
"eslint": "^9.39.3",
45+
"eslint": "^10.0.1",
4646
"eslint-import-resolver-typescript": "^4.4.4",
4747
"eslint-plugin-import-x": "^4.16.1",
4848
"eslint-plugin-unicorn": "^63.0.0",
@@ -77,7 +77,8 @@
7777
"string.prototype.includes": "npm:@nolyfill/string.prototype.includes@^1",
7878
"string.prototype.matchall": "npm:@nolyfill/string.prototype.matchall@^1",
7979
"string.prototype.repeat": "npm:@nolyfill/string.prototype.repeat@^1",
80-
"esbuild@<=0.24.2": ">=0.25.0"
80+
"esbuild@<=0.24.2": ">=0.25.0",
81+
"eslint": "^10.0.1"
8182
}
8283
}
8384
}

packages/commitlint-plugin/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"@commitlint/types": "^20.2.0"
2626
},
2727
"devDependencies": {
28-
"eslint": "^9.39.3",
28+
"eslint": "^10.0.1",
2929
"typescript": "^5.9.3"
3030
}
3131
}

packages/design-system/eslint.config.ts

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,27 @@
11
import baseConfig from '../../eslint.config.base';
22
import { defineConfig, globalIgnores, type Config } from 'eslint/config';
3-
import react from 'eslint-plugin-react';
3+
import { fixupPluginRules } from '@eslint/compat';
4+
import _react from 'eslint-plugin-react';
45
import reactHooks from 'eslint-plugin-react-hooks';
56
import jsxA11y from 'eslint-plugin-jsx-a11y';
67
import storybook from 'eslint-plugin-storybook';
78

9+
// Fix `eslint-plugin-react` to be compatible with ESLint 10.
10+
// Waiting until https://github.com/jsx-eslint/eslint-plugin-react/pull/3979 is merged.
11+
const react = fixupPluginRules(_react);
12+
813
export default defineConfig(
914
...baseConfig,
1015

1116
// React rules.
12-
react.configs.flat.recommended as Config,
13-
react.configs.flat['jsx-runtime'] as Config,
17+
{
18+
..._react.configs.flat.recommended,
19+
plugins: { react },
20+
},
21+
{
22+
..._react.configs.flat['jsx-runtime'],
23+
plugins: { react },
24+
},
1425

1526
reactHooks.configs.flat.recommended,
1627

packages/design-system/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@
7777
"devDependencies": {
7878
"@arethetypeswrong/cli": "^0.18.2",
7979
"@drivenets/vite-plugin-design-system": "workspace:*",
80+
"@eslint/compat": "^2.0.2",
8081
"@faker-js/faker": "^10.3.0",
8182
"@hookform/resolvers": "^5.2.2",
8283
"@rollup/plugin-babel": "^6.1.0",
@@ -94,7 +95,7 @@
9495
"@vitest/browser-playwright": "^4.0.18",
9596
"@vitest/coverage-v8": "^4.0.18",
9697
"babel-plugin-react-compiler": "^1.0.0",
97-
"eslint": "^9.39.3",
98+
"eslint": "^10.0.1",
9899
"eslint-plugin-jsx-a11y": "^6.10.2",
99100
"eslint-plugin-react": "^7.37.5",
100101
"eslint-plugin-react-hooks": "^7.0.1",

packages/eslint-plugin/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,15 @@
4545
"devDependencies": {
4646
"@arethetypeswrong/cli": "^0.18.2",
4747
"@vitest/coverage-v8": "^4.0.18",
48-
"eslint": "^9.39.3",
48+
"eslint": "^10.0.1",
4949
"publint": "^0.3.17",
5050
"tsdown": "^0.20.3",
5151
"typescript": "^5.9.3",
5252
"vitest": "^4.0.18"
5353
},
5454
"peerDependencies": {
5555
"@typescript-eslint/parser": "^8.50.0",
56-
"eslint": "^9.0.0",
56+
"eslint": "^9.0.0 || ^10.0.0",
5757
"typescript": "^5.0.0"
5858
}
5959
}

packages/vite-plugin/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
"devDependencies": {
5050
"@arethetypeswrong/cli": "^0.18.2",
5151
"@vitest/coverage-v8": "^4.0.18",
52-
"eslint": "^9.39.3",
52+
"eslint": "^10.0.1",
5353
"memfs": "^4.56.10",
5454
"publint": "^0.3.17",
5555
"tsdown": "^0.20.3",

0 commit comments

Comments
 (0)