Skip to content

Commit 723c730

Browse files
committed
chore(eslint): migrate to eslint 9 flat config
1 parent 9abb907 commit 723c730

8 files changed

Lines changed: 3303 additions & 2528 deletions

File tree

.eslintrc.cjs

Lines changed: 0 additions & 39 deletions
This file was deleted.

eslint.config.js

Lines changed: 31 additions & 0 deletions
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

Lines changed: 26 additions & 25 deletions
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",
@@ -53,31 +53,32 @@
5353
"singleQuote": true
5454
},
5555
"devDependencies": {
56-
"@testing-library/jest-dom": "^6.4.5",
57-
"@testing-library/react": "^15.0.7",
58-
"@testing-library/user-event": "^14.5.2",
59-
"@types/node": "^20.12.12",
60-
"@types/react": "^18.3.3",
61-
"@types/react-dom": "^18.3.0",
62-
"@typescript-eslint/eslint-plugin": "^7.11.0",
63-
"@typescript-eslint/parser": "^7.11.0",
64-
"derive-valtio": "link:.",
65-
"eslint": "^8.57.0",
66-
"eslint-config-prettier": "^9.1.0",
67-
"eslint-import-resolver-typescript": "^3.6.1",
68-
"eslint-plugin-import": "^2.29.1",
69-
"eslint-plugin-jsx-a11y": "^6.8.0",
70-
"eslint-plugin-react": "^7.34.2",
71-
"eslint-plugin-react-hooks": "^4.6.2",
72-
"happy-dom": "^14.11.4",
73-
"prettier": "^3.2.5",
74-
"react": "^19.0.0-rc-6f23540c7d-20240528",
75-
"react-dom": "^19.0.0-rc-6f23540c7d-20240528",
56+
"@eslint/js": "^9.19.0",
57+
"@testing-library/jest-dom": "^6.6.3",
58+
"@testing-library/react": "^16.2.0",
59+
"@testing-library/user-event": "^14.6.1",
60+
"@types/node": "^22.10.10",
61+
"@types/react": "^19.0.8",
62+
"@types/react-dom": "^19.0.3",
63+
"derive-valtio": "link:",
64+
"eslint": "^9.19.0",
65+
"eslint-import-resolver-typescript": "^3.7.0",
66+
"eslint-plugin-import": "^2.31.0",
67+
"eslint-plugin-jsx-a11y": "^6.10.2",
68+
"eslint-plugin-react": "^7.37.4",
69+
"eslint-plugin-react-compiler": "19.0.0-beta-decd7b8-20250118",
70+
"eslint-plugin-react-hooks": "5.2.0-canary-de1eaa26-20250124",
71+
"happy-dom": "^16.7.2",
72+
"prettier": "^3.4.2",
73+
"react": "^19.0.0",
74+
"react-dom": "^19.0.0",
7675
"ts-expect": "^1.3.0",
77-
"typescript": "^5.4.5",
78-
"valtio": "^2.0.0-rc.0",
79-
"vite": "^5.2.12",
80-
"vitest": "^1.6.0"
76+
"typescript": "^5.7.3",
77+
"typescript-eslint": "^8.21.0",
78+
"valtio": "^2.1.2",
79+
"vite": "^6.0.11",
80+
"vite-tsconfig-paths": "^5.1.4",
81+
"vitest": "^3.0.4"
8182
},
8283
"peerDependencies": {
8384
"valtio": ">=2.0.0-rc.0"

0 commit comments

Comments
 (0)