@@ -56,45 +56,37 @@ npm install --save-dev @eslint-react/eslint-plugin
56
56
57
57
### Setup
58
58
59
- Add ` @eslint-react ` to the plugins section of your ` .eslintrc .js` configuration file.
59
+ Add the plugin to your ` eslint.config .js` :
60
60
61
61
``` js
62
- module .exports = {
63
- // ...
64
- parser: " @typescript-eslint/parser" ,
65
- extends: [" plugin:@eslint-react/recommended-legacy" ],
66
- plugins: [" @eslint-react" ],
67
- // ...
68
- };
62
+ // @ts-check
63
+
64
+ import eslint from " @eslint/js" ;
65
+ import tseslint from " typescript-eslint" ;
66
+ import eslintReact from " @eslint-react/eslint-plugin" ;
67
+
68
+ export default tseslint .config (
69
+ eslint .configs .recommended ,
70
+ ... tseslint .configs .recommended ,
71
+ {
72
+ files: [" src/**/*.{ts,tsx}" ],
73
+ ... eslintReact .configs .recommended ,
74
+ },
75
+ );
69
76
```
70
77
71
78
[ Full Installation Guide ↗] ( https://eslint-react.xyz/docs/installation )
72
79
73
80
## Presets
74
81
75
- ### LegacyConfig presets
76
-
77
- > [ !IMPORTANT] \
78
- > These presets are for ESLint ` LegacyConfig ` (` .eslintrc.* ` ) only
79
-
80
- - ** recommended-legacy** (` plugin:@eslint-react/recommended-legacy ` )\
81
- Enable rules that are recommended by ESLint React.
82
- - ** recommended-type-checked-legacy** (` plugin:@eslint-react/recommended-type-checked-legacy ` )\
83
- Enable rules that are recommended by ESLint React with additional rules that require type information.
84
- - ** all-legacy** (` plugin:@eslint-react/all-legacy ` )\
85
- Enable all rules in this plugin except for debug rules.
86
- - ** off-legacy** (` plugin:@eslint-react/off-legacy ` )\
87
- Disable all rules in this plugin except for debug rules.
88
-
89
- ### FlatConfig presets
90
-
91
- > [ !IMPORTANT] \
92
- > These presets are for ESLint ` FlatConfig ` (` eslint.config.js ` ) only
93
-
94
82
- ** recommended** \
95
83
Enable rules that are recommended by ESLint React.
96
84
- ** recommended-type-checked** \
97
85
Enable rules that are recommended by ESLint React with additional rules that require type information.
86
+ - ** dom** \
87
+ Enable rules that are specific to React DOM.
88
+ - ** off-dom** \
89
+ Disable rules that are specific to React DOM.
98
90
- ** all** \
99
91
Enable all rules in this plugin except for debug rules.
100
92
- ** off** \
0 commit comments