Commit d93f91c 1 parent d4ec690 commit d93f91c Copy full SHA for d93f91c
File tree 4 files changed +42
-4
lines changed
packages/create-rsbuild/template-eslint
4 files changed +42
-4
lines changed Original file line number Diff line number Diff line change 1
- import { fixupConfigRules } from '@eslint/compat' ;
1
+ import { fixupConfigRules , fixupPluginRules } from '@eslint/compat' ;
2
2
import js from '@eslint/js' ;
3
+ import reactHooks from 'eslint-plugin-react-hooks' ;
4
+ import reactJsx from 'eslint-plugin-react/configs/jsx-runtime.js' ;
3
5
import react from 'eslint-plugin-react/configs/recommended.js' ;
4
6
import globals from 'globals' ;
5
7
6
8
export default [
7
9
{ languageOptions : { globals : globals . browser } } ,
8
10
js . configs . recommended ,
9
- ...fixupConfigRules ( react ) ,
11
+ ...fixupConfigRules ( [
12
+ {
13
+ ...react ,
14
+ settings : {
15
+ react : { version : 'detect' } ,
16
+ } ,
17
+ } ,
18
+ reactJsx ,
19
+ ] ) ,
20
+ {
21
+ plugins : {
22
+ 'react-hooks' : fixupPluginRules ( reactHooks ) ,
23
+ } ,
24
+ rules : {
25
+ ...reactHooks . configs . recommended . rules ,
26
+ } ,
27
+ } ,
10
28
{ ignores : [ 'dist/' ] } ,
11
29
] ;
Original file line number Diff line number Diff line change 7
7
"@eslint/js" : " ^9.4.0" ,
8
8
"eslint" : " 9.x" ,
9
9
"eslint-plugin-react" : " ^7.34.2" ,
10
+ "eslint-plugin-react-hooks" : " ^4.6.2" ,
10
11
"globals" : " ^15.4.0"
11
12
}
12
13
}
Original file line number Diff line number Diff line change 1
- import { fixupConfigRules } from '@eslint/compat' ;
1
+ import { fixupConfigRules , fixupPluginRules } from '@eslint/compat' ;
2
2
import js from '@eslint/js' ;
3
+ import reactHooks from 'eslint-plugin-react-hooks' ;
4
+ import reactJsx from 'eslint-plugin-react/configs/jsx-runtime.js' ;
3
5
import react from 'eslint-plugin-react/configs/recommended.js' ;
4
6
import globals from 'globals' ;
5
7
import ts from 'typescript-eslint' ;
@@ -8,6 +10,22 @@ export default [
8
10
{ languageOptions : { globals : globals . browser } } ,
9
11
js . configs . recommended ,
10
12
...ts . configs . recommended ,
11
- ...fixupConfigRules ( react ) ,
13
+ ...fixupConfigRules ( [
14
+ {
15
+ ...react ,
16
+ settings : {
17
+ react : { version : 'detect' } ,
18
+ } ,
19
+ } ,
20
+ reactJsx ,
21
+ ] ) ,
22
+ {
23
+ plugins : {
24
+ 'react-hooks' : fixupPluginRules ( reactHooks ) ,
25
+ } ,
26
+ rules : {
27
+ ...reactHooks . configs . recommended . rules ,
28
+ } ,
29
+ } ,
12
30
{ ignores : [ 'dist/' ] } ,
13
31
] ;
Original file line number Diff line number Diff line change 7
7
"@eslint/js" : " ^9.4.0" ,
8
8
"eslint" : " 9.x" ,
9
9
"eslint-plugin-react" : " ^7.34.2" ,
10
+ "eslint-plugin-react-hooks" : " ^4.6.2" ,
10
11
"globals" : " ^15.4.0" ,
11
12
"typescript-eslint" : " ^7.12.0"
12
13
}
You can’t perform that action at this time.
0 commit comments