eslint-config-react-app provides the official ESLint configuration used by Create React App projects. It ensures a consistent and opinionated linting setup, enforcing best practices for React applications, JavaScript/TypeScript syntax, accessibility, and code quality without requiring extensive manual configuration. The package is currently stable at version 7.0.1, with updates typically coinciding with major Create React App releases to align with new React features, tool updates (like Webpack, Jest, ESLint itself), and evolving language standards. Its primary differentiator is its tight integration and maintenance by the Create React App team, offering a battle-tested and low-overhead solution for linting React projects initialized with CRA. This configuration simplifies managing a complex ESLint setup, making it ideal for developers who prefer a zero-configuration start for their React projects and rely on community-vetted defaults.
npm install eslint-config-react-appVerified import paths — ran on the pinned version, not inferred.
This quickstart shows how to configure ESLint to extend `eslint-config-react-app` in a `.eslintrc.json` file for a Create React App project, including Jest rules, and provides an example `package.json` with relevant dependencies and lint script.
Ensure `eslint` is updated to a compatible version (e.g., `^8.0.0`) and that your `react-scripts` package is also updated to v5.0.0 or later to maintain full compatibility with the updated tooling chain.
Update `react`, `react-dom` to `^17.0.0` (or newer) and `typescript` to `^4.0.0` (or newer) as appropriate for your project. Be aware of the new JSX transform, which changes how `React` needs to be imported for JSX.
Review the specific vulnerability details and the `eslint-config-react-app` release notes. Often, these warnings can be safely ignored for Create React App projects if the project is up-to-date with `react-scripts` and `eslint-config-react-app` maintenance releases, as they typically include patches or mitigations. Avoid unnecessary manual dependency overrides which might introduce new issues.
For new React 18 projects, ensure your `index.js` uses `ReactDOM.createRoot().render()` instead of `ReactDOM.render()`. For existing projects, update your `react-scripts` to v5.0.1 or newer and adjust your `index.js` to use `createRoot` if migrating to React 18.
Add `"react/react-in-jsx-scope": "off"` and `"react/jsx-uses-react": "off"` to the `rules` section of your `.eslintrc.json` file. Ensure your Babel or TypeScript configuration is set to use the automatic JSX runtime.
Run `npm install --save-dev eslint-config-react-app eslint` or `yarn add --dev eslint-config-react-app eslint` to install the package and its peer dependency. Verify your `.eslintrc` file correctly references `"extends": "react-app"`.
Ensure `eslint-plugin-react` is correctly configured and that your `.eslintrc.json` extends `react-app`. If using React 17+ and the new JSX transform, ensure `"react/react-in-jsx-scope": "off"` and `"react/jsx-uses-react": "off"` rules are applied as described above.