eslint-plugin-react-compiler
TypeScript icon, indicating that this package has built-in type declarations

19.1.0-rc.1 • Public • Published

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

Flat config

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

+ 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.configs.recommended    
]

Legacy config (.eslintrc)

Add react-compiler to the plugins section of your 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.

/eslint-plugin-react-compiler/

    Package Sidebar

    Install

    npm i eslint-plugin-react-compiler

    Weekly Downloads

    492,044

    Version

    19.1.0-rc.1

    License

    MIT

    Unpacked Size

    1.84 MB

    Total Files

    4

    Last publish

    Collaborators

    • fb
    • react-bot