Skip to content

Commit fbf7ca4

Browse files
committed
chore(eslint): migrate to eslint 9 flat config
1 parent e2aa105 commit fbf7ca4

File tree

8 files changed

+4327
-2946
lines changed

8 files changed

+4327
-2946
lines changed

.eslintrc.cjs

Lines changed: 0 additions & 34 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 { FlatCompat } from '@eslint/eslintrc';
3+
import tseslint from 'typescript-eslint';
4+
import importPlugin from 'eslint-plugin-import';
5+
import jsxA11y from 'eslint-plugin-jsx-a11y';
6+
import react from 'eslint-plugin-react';
7+
8+
const compat = new FlatCompat();
9+
10+
export default tseslint.config(
11+
{ ignores: ['dist/', 'website/'] },
12+
eslint.configs.recommended,
13+
tseslint.configs.recommended,
14+
importPlugin.flatConfigs.recommended,
15+
jsxA11y.flatConfigs.recommended,
16+
react.configs.flat.recommended,
17+
react.configs.flat['jsx-runtime'],
18+
...compat.extends('plugin:react-hooks/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: 21 additions & 12 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",
@@ -54,19 +54,28 @@
5454
"proxy-compare": "^3.0.0"
5555
},
5656
"devDependencies": {
57-
"@types/node": "^20.12.8",
58-
"@typescript-eslint/eslint-plugin": "^7.8.0",
59-
"@typescript-eslint/parser": "^7.8.0",
57+
"@eslint/js": "^9.18.0",
58+
"@testing-library/jest-dom": "^6.6.3",
59+
"@testing-library/react": "^16.1.0",
60+
"@testing-library/user-event": "^14.5.2",
61+
"@types/node": "^22.10.5",
62+
"@typescript-eslint/eslint-plugin": "^8.19.1",
63+
"@typescript-eslint/parser": "^8.19.1",
6064
"documentation": "^14.0.3",
61-
"eslint": "8.57.0",
62-
"eslint-config-prettier": "^9.1.0",
63-
"eslint-import-resolver-typescript": "^3.6.1",
64-
"eslint-plugin-import": "^2.29.1",
65+
"eslint": "^9.18.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-hooks": "^5.1.0",
71+
"happy-dom": "^16.5.3",
6572
"immer": "^10.1.1",
66-
"prettier": "^3.2.5",
73+
"prettier": "^3.4.2",
6774
"ts-expect": "^1.3.0",
68-
"typescript": "^5.4.5",
69-
"vite": "^5.2.10",
70-
"vitest": "^1.5.3"
75+
"typescript": "^5.7.3",
76+
"typescript-eslint": "^8.19.1",
77+
"vite": "^6.0.7",
78+
"vite-tsconfig-paths": "^5.1.4",
79+
"vitest": "^2.1.8"
7180
}
7281
}

0 commit comments

Comments
 (0)