Skip to content

Commit d0af207

Browse files
authored
chore(eslint): migrate to eslint 9 flat config (#28)
1 parent c249e7a commit d0af207

7 files changed

+3290
-2532
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

+28-27
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,35 +53,36 @@
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",
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",
5960
"@trpc/client": "^10.45.2",
6061
"@trpc/server": "^10.45.2",
61-
"@types/node": "^20.12.12",
62-
"@types/react": "^18.3.2",
63-
"@types/react-dom": "^18.3.0",
64-
"@typescript-eslint/eslint-plugin": "^7.10.0",
65-
"@typescript-eslint/parser": "^7.10.0",
66-
"eslint": "^8.57.0",
67-
"eslint-config-prettier": "^9.1.0",
68-
"eslint-import-resolver-typescript": "^3.6.1",
69-
"eslint-plugin-import": "^2.29.1",
70-
"eslint-plugin-jsx-a11y": "^6.8.0",
71-
"eslint-plugin-react": "^7.34.1",
72-
"eslint-plugin-react-hooks": "^4.6.2",
73-
"happy-dom": "^14.11.0",
74-
"jotai": "^2.8.1",
75-
"jotai-trpc": "link:.",
76-
"prettier": "^3.2.5",
77-
"react": "^18.3.1",
78-
"react-dom": "^18.3.1",
79-
"react-error-boundary": "^4.0.13",
80-
"trpc-pokemon": "^2.0.0-next.0",
62+
"@types/node": "^22.10.10",
63+
"@types/react": "^19.0.8",
64+
"@types/react-dom": "^19.0.3",
65+
"eslint": "^9.19.0",
66+
"eslint-import-resolver-typescript": "^3.7.0",
67+
"eslint-plugin-import": "^2.31.0",
68+
"eslint-plugin-jsx-a11y": "^6.10.2",
69+
"eslint-plugin-react": "^7.37.4",
70+
"eslint-plugin-react-compiler": "19.0.0-beta-decd7b8-20250118",
71+
"eslint-plugin-react-hooks": "5.2.0-canary-de1eaa26-20250124",
72+
"happy-dom": "^16.7.2",
73+
"jotai": "^2.11.1",
74+
"jotai-trpc": "link:",
75+
"prettier": "^3.4.2",
76+
"react": "^19.0.0",
77+
"react-dom": "^19.0.0",
78+
"react-error-boundary": "^5.0.0",
79+
"trpc-pokemon": "2.0.0-next.0",
8180
"ts-expect": "^1.3.0",
82-
"typescript": "^5.4.5",
83-
"vite": "^5.2.11",
84-
"vitest": "^1.6.0"
81+
"typescript": "^5.7.3",
82+
"typescript-eslint": "^8.21.0",
83+
"vite": "^6.0.11",
84+
"vite-tsconfig-paths": "^5.1.4",
85+
"vitest": "^3.0.4"
8586
},
8687
"peerDependencies": {
8788
"@trpc/client": ">=10.0.0",

0 commit comments

Comments
 (0)