File tree 2 files changed +17
-13
lines changed 2 files changed +17
-13
lines changed Original file line number Diff line number Diff line change @@ -39,16 +39,19 @@ import reactX from 'eslint-plugin-react-x'
39
39
import reactDom from ' eslint-plugin-react-dom'
40
40
41
41
export default tseslint .config ({
42
- plugins: {
43
- // Add the react-x and react-dom plugins
44
- ' react-x' : reactX,
45
- ' react-dom' : reactDom,
46
- },
47
- rules: {
48
- // other rules...
49
- // Enable its recommended typescript rules
50
- ... reactX .configs [' recommended-typescript' ].rules ,
51
- ... reactDom .configs .recommended .rules ,
42
+ extends: [
43
+ // other configs...
44
+ // Enable lint rules for React
45
+ reactX .configs [' recommended-typescript' ],
46
+ // Enable lint rules for React DOM
47
+ reactDom .configs .recommended ,
48
+ ],
49
+ languageOptions: {
50
+ // other options...
51
+ parserOptions: {
52
+ project: [' ./tsconfig.node.json' , ' ./tsconfig.app.json' ],
53
+ tsconfigRootDir: import .meta.dirname,
54
+ },
52
55
},
53
56
})
54
57
```
Original file line number Diff line number Diff line change @@ -2,11 +2,13 @@ import js from '@eslint/js'
2
2
import globals from 'globals'
3
3
import reactHooks from 'eslint-plugin-react-hooks'
4
4
import reactRefresh from 'eslint-plugin-react-refresh'
5
+ import { defineConfig } from 'eslint/config'
5
6
6
- export default [
7
+ export default defineConfig ( [
7
8
{ ignores : [ 'dist' ] } ,
8
9
{
9
10
files : [ '**/*.{js,jsx}' ] ,
11
+ extends : [ js . configs . recommended ] ,
10
12
languageOptions : {
11
13
ecmaVersion : 2020 ,
12
14
globals : globals . browser ,
@@ -21,7 +23,6 @@ export default [
21
23
'react-refresh' : reactRefresh ,
22
24
} ,
23
25
rules : {
24
- ...js . configs . recommended . rules ,
25
26
...reactHooks . configs . recommended . rules ,
26
27
'no-unused-vars' : [ 'error' , { varsIgnorePattern : '^[A-Z_]' } ] ,
27
28
'react-refresh/only-export-components' : [
@@ -30,4 +31,4 @@ export default [
30
31
] ,
31
32
} ,
32
33
} ,
33
- ]
34
+ ] )
You can’t perform that action at this time.
0 commit comments