Skip to content

Commit 1b88adc

Browse files
committed
chore(eslint): migrate to eslint 9 flat config
1 parent 206f520 commit 1b88adc

7 files changed

+3184
-2261
lines changed

.eslintrc.cjs

-39
This file was deleted.

eslint.config.js

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import eslint from '@eslint/js';
2+
import tseslint from 'typescript-eslint';
3+
import importPlugin from 'eslint-plugin-import';
4+
import jsxA11y from 'eslint-plugin-jsx-a11y';
5+
import react from 'eslint-plugin-react';
6+
import reactHooks from 'eslint-plugin-react-hooks';
7+
import reactCompiler from 'eslint-plugin-react-compiler';
8+
9+
export default tseslint.config(
10+
{ ignores: ['dist/', 'website/'] },
11+
eslint.configs.recommended,
12+
tseslint.configs.recommended,
13+
importPlugin.flatConfigs.recommended,
14+
jsxA11y.flatConfigs.recommended,
15+
react.configs.flat.recommended,
16+
react.configs.flat['jsx-runtime'],
17+
reactHooks.configs['recommended-latest'],
18+
reactCompiler.configs.recommended,
19+
{
20+
settings: {
21+
'import/resolver': { typescript: true },
22+
react: { version: 'detect' },
23+
},
24+
rules: {
25+
'@typescript-eslint/no-unused-vars': [
26+
'error',
27+
{ argsIgnorePattern: '^_', varsIgnorePattern: '^_' },
28+
],
29+
},
30+
},
31+
);

package.json

+22-21
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"src",
3030
"dist"
3131
],
32-
"packageManager": "pnpm@8.15.0",
32+
"packageManager": "pnpm@9.4.0",
3333
"scripts": {
3434
"compile": "rm -rf dist && pnpm run '/^compile:.*/'",
3535
"compile:esm": "tsc -p tsconfig.esm.json",
@@ -51,31 +51,32 @@
5151
"singleQuote": true
5252
},
5353
"devDependencies": {
54+
"@eslint/js": "^9.19.0",
5455
"@testing-library/jest-dom": "^6.6.3",
55-
"@testing-library/react": "^16.0.1",
56-
"@testing-library/user-event": "^14.5.2",
57-
"@types/node": "^22.9.0",
58-
"@types/react": "^18.3.12",
59-
"@types/react-dom": "^18.3.1",
60-
"@typescript-eslint/eslint-plugin": "^8.15.0",
61-
"@typescript-eslint/parser": "^8.15.0",
62-
"eslint": "8.57.0",
63-
"eslint-config-prettier": "^9.1.0",
64-
"eslint-import-resolver-typescript": "^3.6.3",
56+
"@testing-library/react": "^16.2.0",
57+
"@testing-library/user-event": "^14.6.1",
58+
"@types/node": "^22.10.10",
59+
"@types/react": "^19.0.8",
60+
"@types/react-dom": "^19.0.3",
61+
"eslint": "9.19.0",
62+
"eslint-import-resolver-typescript": "^3.7.0",
6563
"eslint-plugin-import": "^2.31.0",
6664
"eslint-plugin-jsx-a11y": "^6.10.2",
67-
"eslint-plugin-react": "^7.37.2",
68-
"eslint-plugin-react-hooks": "^5.0.0",
69-
"happy-dom": "^15.11.6",
70-
"prettier": "^3.3.3",
71-
"react": "^18.3.1",
72-
"react-dom": "^18.3.1",
65+
"eslint-plugin-react": "^7.37.4",
66+
"eslint-plugin-react-compiler": "19.0.0-beta-decd7b8-20250118",
67+
"eslint-plugin-react-hooks": "5.2.0-canary-de1eaa26-20250124",
68+
"happy-dom": "^16.7.2",
69+
"prettier": "^3.4.2",
70+
"react": "^19.0.0",
71+
"react-dom": "^19.0.0",
7372
"ts-expect": "^1.3.0",
74-
"typescript": "^5.6.3",
73+
"typescript": "^5.7.3",
74+
"typescript-eslint": "^8.21.0",
7575
"valtio": "^2.1.2",
76-
"valtio-reactive": "link:.",
77-
"vite": "^5.4.11",
78-
"vitest": "^2.1.5"
76+
"valtio-reactive": "link:",
77+
"vite": "^6.0.11",
78+
"vite-tsconfig-paths": "^5.1.4",
79+
"vitest": "^3.0.4"
7980
},
8081
"peerDependencies": {
8182
"valtio": ">=2.0.0"

0 commit comments

Comments
 (0)