» npm install eslint-plugin-react-19-upgrade
» npm install eslint-plugin-react
Videos
» npm install eslint-plugin-react-compiler
» npm install @eslint-react/eslint-plugin
it seems that the following plugins are sufficient for my usage of React and Typescript.
"@typescript-eslint/eslint-plugin": "^5.59.9","@typescript-eslint/parser": "^5.59.9","eslint-plugin-react-hooks": "^4.6.0","eslint-plugin-react-refresh": "^0.4.3",
I'm unsure if eslint-plugin-react provides any useful rules.
Could you provide some examples? Thanks.
Add this to your config in ESLint Config File, i.e. .eslintrc or eslint.config.js
{
"settings": {
"react": {
"version": "detect"
}
}
}
See the config here: https://github.com/jsx-eslint/eslint-plugin-react/blob/master/README.md#configuration
Docs
https://eslint.org/docs/
https://eslint.org/docs/latest/use/configure/migration-guide
https://eslint.org/docs/latest/use/configure/configuration-files
If you're looking at the new eslint.config.js, I did the below (with typescript). I tried to follow the official README but it wasn't too helpful.
import react from "eslint-plugin-react";
import typescriptEslint from "@typescript-eslint/eslint-plugin";
import typescriptParser from "@typescript-eslint/parser";
import globals from "globals";
import reactRecommended from "eslint-plugin-react/configs/recommended.js";
export default [
{
ignores: ["dist/**/*"],
},
{
files: ["**/*.{js,jsx,mjs,cjs,ts,tsx}"],
ignores: ["dist/**/*"],
...reactRecommended,
settings: {
version: "detect",
},
languageOptions: {
...reactRecommended.languageOptions,
ecmaVersion: "latest",
sourceType: "module",
parser: typescriptParser,
parserOptions: {
ecmaFeatures: {
jsx: true,
},
},
globals: {
...globals.serviceworker,
...globals.browser,
},
},
plugins: {
"@typescript-eslint": typescriptEslint,
react,
},
rules: {
//rules here
},
},
];
Hey guys, according React 19.2 blog-post we are supposed to use eslint-plugin-react-hooks 6,
But I can already see that 7 is availabe. What did you guys use?
Also, I notice that 7 gave me several new errors, but those errors are not connected to the IDE and are only shown when the 'lint' command is ran. I know we are supposed to use the new hook with Effects now, but I was wondering why no visual warning for the IDE, anyone else?
edit: I found out that i just need to restart my eslint server, and now the errors are properly showing :).
in vscode its CTRL+SHIFT+P and write restart eslint, it will show.
Hi all!
I am currently trying to upgrade eslint to v9 in some projects and am running into a few issues here and there.
I think the biggest issue is that CRA is dropped (we already migrated to Vite) and eslint-config-react-app is no longer maintained, which we have been using since a few years now. I have been trying to re-implement it locally in a project, but that's a really tedious act, e.g. validating which rules are not needed.
Did anyone run into this issue as well? What did you do?
And generally: What does your eslint v9 config look like?
PS: Please don't recommend Biome, Oxlint or other tools as a replacement. I am aware of these and they look really promising, but they do not meet our requirements (yet!) :)