|
1 | 1 | import js from '@eslint/js'
|
2 | 2 | import globals from 'globals'
|
| 3 | +import react from 'eslint-plugin-react' |
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 | 7 |
|
7 | 8 | export default tseslint.config(
|
8 | 9 | { ignores: ['dist'] },
|
9 | 10 | {
|
10 |
| - extends: [js.configs.recommended, ...tseslint.configs.recommended], |
| 11 | + settings: { react: { version: '18.3' } }, |
| 12 | + extends: [js.configs.recommended, ...tseslint.configs.recommendedTypeChecked], |
11 | 13 | files: ['**/*.{ts,tsx}'],
|
12 | 14 | languageOptions: {
|
13 | 15 | ecmaVersion: 2020,
|
14 | 16 | globals: globals.browser,
|
| 17 | + parserOptions: { |
| 18 | + project: ['./tsconfig.node.json', './tsconfig.app.json'], |
| 19 | + tsconfigRootDir: import.meta.dirname, |
| 20 | + }, |
15 | 21 | },
|
16 | 22 | plugins: {
|
| 23 | + react, |
17 | 24 | 'react-hooks': reactHooks,
|
18 | 25 | 'react-refresh': reactRefresh,
|
19 | 26 | },
|
20 | 27 | rules: {
|
| 28 | + ...react.configs.recommended.rules, |
| 29 | + ...react.configs['jsx-runtime'].rules, |
21 | 30 | ...reactHooks.configs.recommended.rules,
|
22 | 31 | 'react-refresh/only-export-components': [
|
23 | 32 | 'warn',
|
|
0 commit comments