🌐
GitHub
github.com › jsx-eslint › eslint-plugin-react
GitHub - jsx-eslint/eslint-plugin-react: React-specific linting rules for ESLint · GitHub
This plugin exports a recommended configuration that enforces React good practices. To enable this configuration use the extends property in your .eslintrc config file:
Starred by 9.3K users
Forked by 2.7K users
Languages   JavaScript
🌐
npm
npmjs.com › package › eslint-plugin-react
eslint-plugin-react - npm
React specific linting rules for ESLint. Latest version: 7.37.5, last published: a year ago. Start using eslint-plugin-react in your project by running `npm i eslint-plugin-react`. There are 16982 other projects in the npm registry using eslint-plugin-react.
      » npm install eslint-plugin-react
    
Published   Apr 03, 2025
Version   7.37.5
Author   Yannick Croissant
🌐
Medium
medium.com › @RossWhitehouse › setting-up-eslint-in-react-c20015ef35f7
Setting up ESLint in React
April 13, 2018 - Setting up ESLint in React I love ESLint. It’s a pluggable linter that’s going to tell you if you’ve imported something and not used it, if your function could be short-handed, and loads of …
🌐
freeCodeCamp
freecodecamp.org › news › how-to-add-eslint-to-your-react-project
How to Add ESLint to Your React Project
August 8, 2023 - If ESLint identifies any further ... them. For example, ESLint might detect missing semicolons, unused variables, or violations of React best practices like the import React from “react” in the app.js file....
🌐
ESLint
eslint.org › docs › latest › use › getting-started
Getting Started with ESLint - ESLint - Pluggable JavaScript Linter
Here’s an example: import { defineConfig } from "eslint/config"; import globals from "globals"; import js from "@eslint/js"; export default defineConfig([ { files: ["**/*.js"], languageOptions: { globals: globals.browser } }, { files: ["**/*.js"], plugins: { js }, extends: ["js/recommended"] }, ]);
🌐
DEV Community
dev.to › knowankit › setup-eslint-and-prettier-in-react-app-357b
Setup ESLINT and PRETTIER in React app - DEV Community
September 26, 2021 - "extends": ["eslint:recommended", "plugin:react/recommended", "plugin:prettier/recommended"]
🌐
GeeksforGeeks
geeksforgeeks.org › how-to-configure-eslint-for-react-projects
How to configure ESLint for React Projects ? | GeeksforGeeks
July 22, 2024 - The `import-plugin` will help us identify common problems while importing and exporting; `jsx-a11y` will catch errors regarding accessibility and the `react` plugin is all about code practices used in React, since we are using `eslint-plugin-react` we will need to inform it which version of React we are using so let's add this in our "settings" property, instead of stating the current React version we will handover this job to settings by using the keyword "detect" so that it will detect the current React version from `package.json`
🌐
Imaginary Cloud
imaginarycloud.com › blog › how-to-configure-eslint-prettier-in-react
How to configure ESLint and Prettier in React
Discover how to configure ESLint and Prettier in React for cleaner code. Follow this step-by-step guide to set up linting and formatting tools.
🌐
React
react.dev › reference › eslint-plugin-react-hooks
eslint-plugin-react-hooks – React
When the compiler reports a diagnostic, it means that the compiler was able to statically detect a pattern that is not supported or breaks the Rules of React. When it detects this, it automatically skips over those components and hooks, while keeping the rest of your app compiled. This ensures optimal coverage of safe optimizations that won’t break your app. What this means for linting, is that you don’t need to fix all violations immediately. Address them at your own pace to gradually increase the number of optimized components. These rules are included in the recommended preset in eslint-plugin-react-hooks:
Find elsewhere
🌐
GitHub
github.com › Rel1cx › eslint-react
GitHub - Rel1cx/eslint-react: 4-7x faster, composable ESLint rules for React and friends.
eslint-plugin-react-x - X rules (renderer-agnostic, compatible with x-platform).
Starred by 490 users
Forked by 39 users
Languages   TypeScript 80.1% | MDX 19.3% | TypeScript 80.1% | MDX 19.3%
🌐
LogRocket
blog.logrocket.com › home › 12 essential eslint rules for react
12 essential ESLint rules for React - LogRocket Blog
June 4, 2024 - If you have a custom Hook with a dependency array, you can set the configuration option additionalHooks, which expects a regular expression defining the names of your custom Hooks. The React team recommends against this in general, as discussed in the eslint-plugin-react-hooks README.
🌐
Upmostly
upmostly.com › home › tutorials › what is eslint and how to use it in react?
What Is ESLint and How To Use It in React? - Upmostly
June 30, 2022 - rules: { 'react/jsx-one-expression-per-line': 'off', 'react/jsx-filename-extension': 'off', }, All of the console ESLint errors had been actioned at this point.
🌐
npm
npmjs.com › package › eslint-plugin-react-hooks
eslint-plugin-react-hooks - npm
// eslint.config.js import reactHooks from 'eslint-plugin-react-hooks'; import { defineConfig } from 'eslint/config'; export default defineConfig([ reactHooks.configs.flat.recommended, ]);
      » npm install eslint-plugin-react-hooks
    
Published   Oct 24, 2025
Version   7.0.1
Homepage   https://react.dev/
🌐
HashStudioz Technologies
hashstudioz.com › home › integrating eslint into your react project
Integrating ESLint: Improve Your React Code Quality
September 4, 2025 - Rules: ESLint rules can be customized to enforce strict style guides (like Airbnb or Google), encourage best practices, and eliminate errors. Each rule can have different severity levels: ... “error” or 2: Code violates the rule and triggers an error, potentially blocking the build process. ... Should you prefer to manually create a foundational configuration file, here is an example setup tailored for a standard React project.
🌐
GitHub
github.com › standard › eslint-config-standard-react
GitHub - standard/eslint-config-standard-react: ESLint Shareable Config for React/JSX support in JavaScript Standard Style · GitHub
npm install --save-dev @babel/core @babel/eslint-parser eslint-config-standard eslint-config-standard-jsx eslint-config-standard-react eslint-plugin-promise eslint-plugin-import eslint-plugin-node eslint-plugin-react
Starred by 458 users
Forked by 86 users
Languages   JavaScript
🌐
Eslint-react
eslint-react.xyz › docs › getting-started › javascript
JavaScript | ESLint React
// @ts-check import tseslint from "typescript-eslint"; export default [ { languageOptions: { parser: tseslint.parser, parserOptions: { projectService: true, tsconfigRootDir: import.meta.dirname, }, }, }, ]; ... { "compilerOptions": { // ...other options "jsx": "react-jsx", "strictNullChecks": true // Recommended for better type inference }, "include": ["**/*.js", "**/*.jsx"] }
Top answer
1 of 4
91

Yes, create-react-app comes with eslint config.

How do I enable and extend it correctly?

You can check how to extend it here.

{
  "eslintConfig": {
    "extends": ["react-app", "shared-config"],
    "rules": {
      "additional-rule": "warn"
    },
    "overrides": [
      {
        "files": ["**/*.ts?(x)"],
        "rules": {
          "additional-typescript-only-rule": "warn"
        }
      }
    ]
  }
}

How do I enable it?

You need to integrate it with your IDE.

How do I run it?

After integrating it, an eslint server will be running in the background and will enable linting for your IDE (sometimes restarting IDE required).


I checked all your claims after running npx create-react-app example:

...one cannot run the eslint command in the project root.

You can:

eslint is installed as part of the project dependency, just by running eslint globally (eslint [cmd]) you need to ensure it installed globally (not recommended).

...ESLint does not seem to be a dependency within package.json.

Why should it be? That's why you using a starter like CRA. It's an inner dependency, you don't need to worry about it, that's CRA's job.

...VS Code doesn't pick up that there is ESLint present.

It does, check the OUTPUT tab and look for ESLint to see the server's output.

...there is no .eslintrc.* file in the project root.

You get the default configuration from CRA (which is hidden from you for focusing on coding). Add such file if you want to override it (you can also extend it, check the docs).


It's very useful to understand what eslint actually is and how we use it React development, check out related question "Do React hooks really have to start with “use”?".

2 of 4
48

To expand on the top comment's answer:

...ESLint does not seem to be a dependency within package.json.

Why should it be? That's why you using a starter like CRA. It's an inner dependency, you don't need to worry about it, that's CRA's job.

A project created with create-react-app will have react-scripts as a dependency.

react-scripts has eslint installed as a dependency, as seen in react-scripts package.json.

You can see if a package is installed (and where) by running npm ls <package> in your project root.

npm ls eslint shows:

└─┬ [email protected]
  └── [email protected] 

This shows the dependency tree that we manually investigated by looking in GitHub at react-scripts.

So - a project made with create-react-app does come with eslint. As it is a dependency, not something globally installed, then it must be ran with a npm script.

This is why running eslint . in your terminal does not work, but using

    "lint": "eslint .",

then npm run lint does. (though you may with to make the command eslint --ignore-path .gitignore . due to a current bug).

Similarly, the eslint configs are installed in react-scripts, then referenced in the default project output's own package.json.

🌐
DhiWise
dhiwise.com › post › unleashing-the-potential-of-react-eslint-an-essential-guide
Boosting Code Quality with React ESLint: A Developers View
September 15, 2023 - In this example, the useEffect hook has a dependency array that includes prop. This follows the rule that the function passed to useEffect should include all variables it uses in its dependency array. The ESLint Plugin React Hooks would enforce this rule and warn you if you missed any dependencies.
🌐
SymfonyCasts
symfonycasts.com › screencast › reactjs › eslint
The World of React + ESLint
Check this out: open assets/js/rep_log.js: this is the file that runs our existing LiftStuff frontend. Here, add const foo = true then if (foo), but leave the body of the if statement empty. See that little red error?
🌐
Eslint-react
eslint-react.xyz › docs › rules › set-state-in-effect
set-state-in-effect | ESLint React
import { useState } from "react"; function List({ items }) { const [isReverse, setIsReverse] = useState(false); const [selectedId, setSelectedId] = useState(null); // ✅ Best: Calculate everything during rendering const selection = items.find((item) => item.id === selectedId) ?? null; // ... ...