mirror of
https://github.com/zebrajr/react.git
synced 2025-12-08 07:38:51 +01:00
## Summary This change fixes a gap in the plugin's support of eslint v9. In one place that it's using the `SourceCode` api, it's correctly considering v9's api. But in the other place where `SourceCode` is used, it's only using the legacy api, which was removed in v9. |
||
|---|---|---|
| .. | ||
| __tests__ | ||
| scripts | ||
| src | ||
| babel.config.js | ||
| package.json | ||
| README.md | ||
| tsconfig.json | ||
eslint-plugin-react-compiler
ESLint plugin surfacing problematic React code found by the React compiler.
Installation
You'll first need to install ESLint:
npm i eslint --save-dev
Next, install eslint-plugin-react-compiler:
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:
{
"plugins": [
"react-compiler"
]
}
Then configure the rules you want to use under the rules section.
{
"rules": {
"react-compiler/react-compiler": "error"
}
}
Rules
TODO: Run eslint-doc-generator to generate the rules list.