mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
1f35f7e320
This adds a new category of error where the compiler cannot preserve memoization exactly how as it was originally authored. We're adding a new category here because it's not an actionable error, and allows us to more specifically control whether it's reportable or not. ghstack-source-id: 9693cd42ca64b980248c6202091bdd4c827e1cd4 Pull Request resolved: https://github.com/facebook/react-forget/pull/2824
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/rule-name": 2
}
}
Rules
TODO: Run eslint-doc-generator to generate the rules list.