How do I use eslint-plugin-react-compiler with eslint 9? #25
-
Hello, I have never used eslint before and I would like to give eslint-plugin-react-compiler a shot. The ESlint docs do not mention an I'm quite confused how to configure this. import reactCompilerPlugin from 'eslint-plugin-react-compiler';
export default [
{
plugins: {
"react-compiler": reactCompilerPlugin
},
rules: {
"react-compiler/react-compiler": "error",
},
files: ["**/*.res.mjs"]
}]; What other dependencies do I btw need to make this work for React 18? Thanks in advance! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
The ESLint ecosystem is currently transitioning from legacy config files (
Yes, except that your import reactCompilerPlugin from 'eslint-plugin-react-compiler';
export default [
/* [...] default configs and settings */
{
plugins: {
"react-compiler": reactCompilerPlugin,
},
rules: {
"react-compiler/react-compiler": "warn",
},
},
{ // The rest of my config
files: ["**/*.{j,t}s{,x}"],
rules: {
/* [...] */
}
},
{
ignores: [ /* global ignores */ ],
},
];
Not sure if you need any other dependencies, it works for me on React 18 after installing only |
Beta Was this translation helpful? Give feedback.
The ESLint ecosystem is currently transitioning from legacy config files (
.eslintrc
) to "flat config" files (eslint.config.js
). It seems like this plugin's docs haven’t been updated to explain how to use it with a flat config.