» npm install eslint-plugin-react
» npm install eslint-plugin-react-hooks
How to use eslint-plugin-react and eslint-plugin-react-hooks, just for myself?
reactjs - Warning: React version not specified in 'eslint-plugin-react settings' while running eslint on top of React 18.2.0 - Stack Overflow
Help with eslint install and dependency problem
What ESLint Plugins Do You Recommend When Using NextJs?
Videos
» npm install @eslint-react/eslint-plugin
» npm install eslint-plugin-react-you-might-not-need-an-effect
Forgive me if this question is poorly worded or misinformed; I'm new to using NPM.
My team has eslint installed as a dev dependency in our project to ensure high code quality. However, we don't use the eslint-plugin-react or eslint-plugin-react-hooks packages. I'd like to install them so that I can follow the best React practices when coding, without actually making changes to the official dependencies used by all developers. Is there a way to go about this (eg, modify a personal "packages.json" that is separate from the project's but will still lint my company's project)?
» npm install eslint-plugin-react-refresh
» npm install eslint-plugin-react-x
» npm install eslint-plugin-react-etc
» npm install eslint-plugin-react-compiler
» npm install eslint-plugin-react-app
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
},
},
];