File tree Expand file tree Collapse file tree 2 files changed +32
-1
lines changed
compiler/packages/eslint-plugin-react-compiler Expand file tree Collapse file tree 2 files changed +32
-1
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,24 @@ npm install eslint-plugin-react-compiler --save-dev
18
18
19
19
## Usage
20
20
21
- Add ` react-compiler ` to the plugins section of your ` .eslintrc ` configuration file. You can omit the ` eslint-plugin- ` prefix:
21
+ ### Flat config
22
+
23
+ Edit your eslint 8+ config (for example ` eslint.config.mjs ` ) with the recommended configuration:
24
+
25
+ ``` diff
26
+ + import reactCompiler from "eslint-plugin-react-compiler"
27
+ import react from "eslint-plugin-react"
28
+
29
+ export default [
30
+ // Your existing config
31
+ { ...pluginReact.configs.flat.recommended, settings: { react: { version: "detect" } } },
32
+ + reactCompiler.config.recommended
33
+ ]
34
+ ```
35
+
36
+ ### Legacy config (` .eslintrc ` )
37
+
38
+ Add ` react-compiler ` to the plugins section of your configuration file. You can omit the ` eslint-plugin- ` prefix:
22
39
23
40
``` json
24
41
{
Original file line number Diff line number Diff line change @@ -11,4 +11,18 @@ module.exports = {
11
11
rules : {
12
12
'react-compiler' : ReactCompilerRule ,
13
13
} ,
14
+ configs : {
15
+ recommended : {
16
+ plugins : {
17
+ 'react-compiler' : {
18
+ rules : {
19
+ 'react-compiler' : ReactCompilerRule ,
20
+ } ,
21
+ } ,
22
+ } ,
23
+ rules : {
24
+ 'react-compiler/react-compiler' : 'error' ,
25
+ } ,
26
+ } ,
27
+ } ,
14
28
} ;
You can’t perform that action at this time.
0 commit comments