|
1 | | -import js from '@eslint/js'; |
| 1 | +import { globalIgnores } from 'eslint/config'; |
2 | 2 | import globals from 'globals'; |
| 3 | +import js from '@eslint/js'; |
3 | 4 | import reactHooks from 'eslint-plugin-react-hooks'; |
4 | 5 | import reactRefresh from 'eslint-plugin-react-refresh'; |
5 | 6 | import tseslint from 'typescript-eslint'; |
6 | | -import { globalIgnores } from 'eslint/config'; |
7 | 7 |
|
8 | 8 | export default tseslint.config([ |
9 | 9 | globalIgnores(['dist', 'node_modules']), |
| 10 | + js.configs.recommended, |
| 11 | + ...tseslint.configs.recommended, |
10 | 12 | { |
11 | 13 | files: ['**/*.{ts,tsx}'], |
12 | | - extends: [ |
13 | | - js.configs.recommended, |
14 | | - tseslint.configs.recommended, |
15 | | - reactHooks.configs['recommended-latest'], |
16 | | - reactRefresh.configs.vite, |
17 | | - ], |
| 14 | + plugins: { |
| 15 | + 'react-hooks': reactHooks, |
| 16 | + 'react-refresh': reactRefresh, |
| 17 | + }, |
18 | 18 | languageOptions: { |
19 | 19 | ecmaVersion: 2020, |
20 | 20 | globals: { |
21 | 21 | ...globals.browser, |
22 | 22 | }, |
| 23 | + parserOptions: { |
| 24 | + ecmaFeatures: { |
| 25 | + jsx: true, |
| 26 | + }, |
| 27 | + }, |
23 | 28 | }, |
24 | 29 | rules: { |
| 30 | + ...reactHooks.configs.recommended.rules, |
25 | 31 | 'react-refresh/only-export-components': ['warn', { allowConstantExport: true }], |
26 | 32 | }, |
27 | 33 | }, |
|
0 commit comments