Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion compiler/packages/eslint-plugin-react-compiler/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,24 @@ npm install eslint-plugin-react-compiler --save-dev

## Usage

Add `react-compiler` to the plugins section of your `.eslintrc` configuration file. You can omit the `eslint-plugin-` prefix:
### Flat config

Edit your eslint 8+ config (for example `eslint.config.mjs`) with the recommended configuration:

```diff
+ import reactCompiler from "eslint-plugin-react-compiler"
import react from "eslint-plugin-react"

export default [
// Your existing config
{ ...pluginReact.configs.flat.recommended, settings: { react: { version: "detect" } } },
+ reactCompiler.config.recommended
]
```

### Legacy config (`.eslintrc`)

Add `react-compiler` to the plugins section of your configuration file. You can omit the `eslint-plugin-` prefix:

```json
{
Expand Down
14 changes: 14 additions & 0 deletions compiler/packages/eslint-plugin-react-compiler/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,18 @@ module.exports = {
rules: {
'react-compiler': ReactCompilerRule,
},
configs: {
recommended: {
plugins: {
'react-compiler': {
rules: {
'react-compiler': ReactCompilerRule,
},
},
},
rules: {
'react-compiler/react-compiler': 'error',
},
},
},
};
Loading