Skip to content

Commit

Permalink
feat: add react-compiler/react-compiler to ESLint config with ref fal…
Browse files Browse the repository at this point in the history
…se positive disable

BREAKING CHANGE: This ESLint plugin will raise new errors in repos, and so we need to cut it as a major
  • Loading branch information
michaeljaltamirano committed Dec 17, 2024
1 parent 0be374c commit 5fd62a6
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = {
root: true,
plugins: ["react", "react-hooks", "jsx-a11y"],
plugins: ["react", "react-hooks", "jsx-a11y", "eslint-plugin-react-compiler"],
env: {
browser: true,
},
Expand Down Expand Up @@ -53,6 +53,20 @@ module.exports = {
"react/state-in-constructor": "off",
// This allows static properties to be placed within the class declaration
"react/static-property-placement": "off",
/** ESLint plugin for the React Compiler, to enforce rules that make adopting it easier/more effective */
"react-compiler/react-compiler": [
"error",
{
environment: {
/**
* At the time of writing, `eslint-plugin-react-compiler` errors on ref usages in render paths. This rule is noisy,
* since it currently reports false positives. We can remove this in the future when the rule is more accurate.
* {@link https://github.com/facebook/react/pull/30843 PR that disables this rule in the default config}
*/
validateRefAccessDuringRender: false,
},
},
],
/*
* Rules that significantly impact performance time of eslint, and are not
* necessarily relevant for react applications.
Expand Down

0 comments on commit 5fd62a6

Please sign in to comment.