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