Skip to content

Commit 399c603

Browse files
authored
chore(eslint): migrate to eslint 9 flat config (#16)
1 parent 953c57e commit 399c603

9 files changed

+3267
-2509
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

+26-25
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
"src",
5050
"dist"
5151
],
52-
"packageManager": "pnpm@8.15.0",
52+
"packageManager": "pnpm@9.4.0",
5353
"scripts": {
5454
"compile": "rm -rf dist && pnpm run '/^compile:.*/'",
5555
"compile:esm": "tsc -p tsconfig.esm.json",
@@ -81,31 +81,32 @@
8181
"create-react-signals": "^0.8.0"
8282
},
8383
"devDependencies": {
84-
"@testing-library/jest-dom": "^6.4.5",
85-
"@testing-library/react": "^15.0.7",
86-
"@testing-library/user-event": "^14.5.2",
87-
"@types/node": "^20.12.12",
88-
"@types/react": "^18.3.2",
89-
"@types/react-dom": "^18.3.0",
90-
"@typescript-eslint/eslint-plugin": "^7.10.0",
91-
"@typescript-eslint/parser": "^7.10.0",
92-
"eslint": "^8.57.0",
93-
"eslint-config-prettier": "^9.1.0",
94-
"eslint-import-resolver-typescript": "^3.6.1",
95-
"eslint-plugin-import": "^2.29.1",
96-
"eslint-plugin-jsx-a11y": "^6.8.0",
97-
"eslint-plugin-react": "^7.34.1",
98-
"eslint-plugin-react-hooks": "^4.6.2",
99-
"happy-dom": "^14.11.0",
100-
"jotai": "^2.8.1",
101-
"jotai-signal": "link:.",
102-
"prettier": "^3.2.5",
103-
"react": "^18.3.1",
104-
"react-dom": "^18.3.1",
84+
"@eslint/js": "^9.19.0",
85+
"@testing-library/jest-dom": "^6.6.3",
86+
"@testing-library/react": "^16.2.0",
87+
"@testing-library/user-event": "^14.6.1",
88+
"@types/node": "^22.10.10",
89+
"@types/react": "^19.0.8",
90+
"@types/react-dom": "^19.0.3",
91+
"eslint": "^9.19.0",
92+
"eslint-import-resolver-typescript": "^3.7.0",
93+
"eslint-plugin-import": "^2.31.0",
94+
"eslint-plugin-jsx-a11y": "^6.10.2",
95+
"eslint-plugin-react": "^7.37.4",
96+
"eslint-plugin-react-compiler": "19.0.0-beta-decd7b8-20250118",
97+
"eslint-plugin-react-hooks": "5.2.0-canary-de1eaa26-20250124",
98+
"happy-dom": "^16.7.2",
99+
"jotai": "^2.11.1",
100+
"jotai-signal": "link:",
101+
"prettier": "^3.4.2",
102+
"react": "^19.0.0",
103+
"react-dom": "^19.0.0",
105104
"ts-expect": "^1.3.0",
106-
"typescript": "^5.4.5",
107-
"vite": "^5.2.11",
108-
"vitest": "^1.6.0"
105+
"typescript": "^5.7.3",
106+
"typescript-eslint": "^8.21.0",
107+
"vite": "^6.0.11",
108+
"vite-tsconfig-paths": "^5.1.4",
109+
"vitest": "^3.0.4"
109110
},
110111
"peerDependencies": {
111112
"jotai": ">=2.0.0",

0 commit comments

Comments
 (0)