eslint-config-react (deprecated ESLint shareable config)
raw JSON → 1.1.7 verified Sat Apr 25 auth: no javascript deprecated
An opinionated ESLint shareable config for React projects (v1.1.7). Last released in 2016, it is unmaintained and superseded by eslint-config-react-app and other modern configs. It bundles a set of ESLint rules plus recommended React plugin rules, but requires manual installation of babel-eslint and eslint-plugin-react. Key differentiators: opinionated, includes rules like arrow-parens and prefer-reflect; however, it does not support ESLint 3+ and actively removed env and certain rules. Not recommended for new projects.
Common errors
error Error: Cannot find module 'eslint-plugin-react' ↓
cause Missing peer dependency eslint-plugin-react.
fix
npm install --save-dev eslint-plugin-react
error Error: Cannot find module 'babel-eslint' ↓
cause Missing peer dependency babel-eslint.
fix
npm install --save-dev babel-eslint
error Error: Failed to load plugin 'react' declared in .eslintrc: Cannot find module 'eslint-plugin-react' ↓
cause Missing plugin dependency or incorrect extends path.
fix
Ensure eslint-plugin-react is installed and remove any typo in the extends field.
error Parsing error: Unexpected token < ↓
cause JSX not parsed because parser is not set to babel-eslint.
fix
Add 'parser': 'babel-eslint' to .eslintrc.
error Definition for rule 'react/jsx-no-target-blank' was not found ↓
cause Version mismatch between config and plugin; config may expect a rule that does not exist in installed eslint-plugin-react version.
fix
Upgrade eslint-plugin-react to latest compatible version or remove the rule.
Warnings
deprecated Package is unmaintained since 2016. Use modern alternatives like eslint-config-react-app or @eslint-react/eslint-plugin. ↓
fix Migrate to eslint-config-react-app: npm install eslint-config-react-app and extend 'react-app'.
breaking v1.1.1 removed 'env' from config. You must set env in your project's .eslintrc. ↓
fix Add env (e.g., 'browser: true') in your .eslintrc file.
breaking v1.0.2 deprecated 'react/jsx-quotes' in favor of 'jsx-quotes'. The config was updated accordingly. ↓
fix Use 'jsx-quotes' rule instead of 'react/jsx-quotes'.
gotcha The config does not set a parser. You must manually set parser to 'babel-eslint' in your project's .eslintrc. ↓
fix Set 'parser': 'babel-eslint' in your .eslintrc.
gotcha The config requires eslint-plugin-react as a peer dependency. Missing it will cause runtime errors. ↓
fix Install eslint-plugin-react: npm install --save-dev eslint-plugin-react
deprecated The config uses deprecated ESLint rules like prefer-reflect (removed in ESLint 3+). ↓
fix Remove or replace 'prefer-reflect' rule with alternatives; upgrade to a modern config.
Install
npm install eslint-config-react yarn add eslint-config-react pnpm add eslint-config-react Imports
- config (extend name 'react') wrong
// Incorrect: extending 'react' from a scoped package { "extends": "@patrio/react" }correct// .eslintrc { "extends": "react" } - ESLint config object wrong
// CJS require - works, but ESM is preferred const config = require('eslint-config-react');correctimport config from 'eslint-config-react'; // if using programmatic API - Plugins usage wrong
// Missing babel-eslint parser { "extends": "react", "parserOptions": { "ecmaFeatures": { "jsx": true } } }correct// .eslintrc { "extends": "react", "plugins": ["react"] // optional, config includes it }
Quickstart
// Install dependencies
npm install --save-dev eslint eslint-config-react babel-eslint eslint-plugin-react
// Create .eslintrc
{
"extends": "react",
"env": {
"browser": true,
"es6": true
},
"parser": "babel-eslint",
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": 6,
"sourceType": "module"
},
"rules": {
// Your overrides
}
}
// Then run ESLint
npx eslint src/