Skip to content

Commit 3f7aa4b

Browse files
authored
chore(eslint): migrate to eslint 9 flat config (#147)
* chore(eslint): migrate to eslint 9 flat config * tweak ignores * update deps * update react hooks & compiler
1 parent 76cf255 commit 3f7aa4b

11 files changed

+4071
-3305
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+
);

examples/03_suspense/src/provider.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/* eslint-disable react-compiler/react-compiler */
2+
13
import {
24
useCallback,
35
useRef,

package.json

+24-23
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",
@@ -55,33 +55,34 @@
5555
"singleQuote": true
5656
},
5757
"devDependencies": {
58-
"@testing-library/jest-dom": "^6.5.0",
59-
"@testing-library/react": "^16.0.1",
60-
"@testing-library/user-event": "^14.5.2",
61-
"@types/node": "^22.5.4",
62-
"@types/react": "^18.3.5",
63-
"@types/react-dom": "^18.3.0",
58+
"@eslint/js": "^9.19.0",
59+
"@testing-library/jest-dom": "^6.6.3",
60+
"@testing-library/react": "^16.2.0",
61+
"@testing-library/user-event": "^14.6.1",
62+
"@types/node": "^22.10.10",
63+
"@types/react": "^19.0.8",
64+
"@types/react-dom": "^19.0.3",
6465
"@types/scheduler": "^0.23.0",
65-
"@typescript-eslint/eslint-plugin": "^8.4.0",
66-
"@typescript-eslint/parser": "^8.4.0",
6766
"documentation": "^14.0.3",
68-
"eslint": "8.57.0",
69-
"eslint-config-prettier": "^9.1.0",
70-
"eslint-import-resolver-typescript": "^3.6.3",
71-
"eslint-plugin-import": "^2.30.0",
72-
"eslint-plugin-jsx-a11y": "^6.10.0",
73-
"eslint-plugin-react": "^7.35.2",
74-
"eslint-plugin-react-hooks": "^4.6.2",
75-
"happy-dom": "^15.7.3",
76-
"prettier": "^3.3.3",
67+
"eslint": "^9.19.0",
68+
"eslint-import-resolver-typescript": "^3.7.0",
69+
"eslint-plugin-import": "^2.31.0",
70+
"eslint-plugin-jsx-a11y": "^6.10.2",
71+
"eslint-plugin-react": "^7.37.4",
72+
"eslint-plugin-react-compiler": "19.0.0-beta-decd7b8-20250118",
73+
"eslint-plugin-react-hooks": "5.2.0-canary-de1eaa26-20250124",
74+
"happy-dom": "^16.7.2",
75+
"prettier": "^3.4.2",
7776
"react": "^18.3.1",
7877
"react-dom": "^18.3.1",
79-
"scheduler": "^0.23.2",
78+
"scheduler": "^0.25.0",
8079
"ts-expect": "^1.3.0",
81-
"typescript": "^5.5.4",
82-
"use-context-selector": "link:.",
83-
"vite": "^5.4.3",
84-
"vitest": "^2.0.5"
80+
"typescript": "^5.7.3",
81+
"typescript-eslint": "^8.21.0",
82+
"use-context-selector": "link:",
83+
"vite": "^6.0.11",
84+
"vite-tsconfig-paths": "^5.1.4",
85+
"vitest": "^3.0.4"
8586
},
8687
"peerDependencies": {
8788
"react": ">=18.0.0",

0 commit comments

Comments
 (0)