Skip to content

Commit deffe7d

Browse files
committed
chore: update eslint-plugin-react-hooks to version 7 and refactor eslint configuration
1 parent c805b2d commit deffe7d

3 files changed

Lines changed: 61 additions & 20 deletions

File tree

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,22 @@
11
import js from '@eslint/js';
22
import globals from 'globals';
33
import reactHooks from 'eslint-plugin-react-hooks';
4-
import reactRefresh from 'eslint-plugin-react-refresh';
4+
import { reactRefresh } from 'eslint-plugin-react-refresh';
55
import tseslint from 'typescript-eslint';
66

77
export default tseslint.config(
88
{ ignores: ['dist'] },
99
{
10-
extends: [js.configs.recommended, ...tseslint.configs.recommended],
10+
extends: [
11+
js.configs.recommended,
12+
...tseslint.configs.recommended,
13+
reactHooks.configs.flat.recommended,
14+
reactRefresh.configs.vite(),
15+
],
1116
files: ['**/*.{ts,tsx}'],
1217
languageOptions: {
1318
ecmaVersion: 2020,
1419
globals: globals.browser,
1520
},
16-
plugins: {
17-
'react-hooks': reactHooks,
18-
'react-refresh': reactRefresh,
19-
},
20-
rules: {
21-
...reactHooks.configs.recommended.rules,
22-
'react-refresh/only-export-components': [
23-
'warn',
24-
{ allowConstantExport: true },
25-
],
26-
},
2721
}
2822
);

bolt-vite-react-ts/package-lock.json

Lines changed: 53 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bolt-vite-react-ts/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"@types/react-dom": "^19",
2424
"@vitejs/plugin-react": "^5",
2525
"eslint": "^9",
26-
"eslint-plugin-react-hooks": "^5",
26+
"eslint-plugin-react-hooks": "^7",
2727
"eslint-plugin-react-refresh": "^0.5.2",
2828
"globals": "^16",
2929
"tailwindcss": "^4",

0 commit comments

Comments
 (0)