Scientyfic World

How to Configure ESLint for React in 2026: Flat Config, Vite and TypeScript

To configure ESLint for a React project in 2026, install ESLint 10 with the official JavaScript rules, the React Hooks plugin and the React Refresh plugin, then describe everything in...

Share:

Get an AI summary of this article

ESLINT for React project

To configure ESLint for a React project in 2026, install ESLint 10 with the official JavaScript rules, the React Hooks plugin and the React Refresh plugin, then describe everything in a single eslint.config.js file using the flat config format. That setup catches broken hook calls, missing effect dependencies and unused variables, and it works with Vite, TypeScript, Prettier, VS Code and CI.

A lot has changed since most ESLint and React guides were written, so older instructions now fail in ways that are hard to diagnose:

  • ESLint 10 removed .eslintrc. ESLint 10.0.0 was released on February 6, 2026, and its migration guide says the old configuration format is no longer supported. ESLint 9 reached end of life on August 6, 2026.
  • Create React App is deprecated. The React team deprecated it on February 14, 2025, so npx create-react-app and its built-in ESLint config are no longer a starting point.
  • Vite’s React templates now ship Oxlint, not ESLint. A project created with create-vite 9.3 has an .oxlintrc.json file and a lint script that runs oxlint.
  • eslint-plugin-react does not officially support ESLint 10 yet. Installing it next to ESLint 10 fails, and forcing it crashes unless you add a compatibility wrapper (covered below).
  • TypeScript 7 has no API. typescript-eslint needs TypeScript 6 for now, so the TypeScript template needs one extra step.

Every command, config file and output in this guide comes from real projects I created and linted on November 18, 2026, using these versions:

PackageVersion tested
Node.js24.22.2 (npm 11.19.1)
eslint / @eslint/js10.15.0 / 10.0.1
eslint-plugin-react-hooks7.1.1
eslint-plugin-react-refresh0.5.8
eslint-plugin-react / eslint-plugin-jsx-a11y7.37.5 / 6.10.2
@eslint-react/eslint-plugin5.30.4
typescript-eslint8.73.0
TypeScript7.0.2 for builds, 6.0.3 for linting
React / Vite / create-vite19.3.1 / 8.3 / 9.3.4
Prettier / eslint-config-prettier3.10.1 / 10.1.8

Step 1: Create a React Project With Vite

Vite is the usual way to start a client-side React app now that Create React App is deprecated. Node.js 20.19 or later is required by ESLint 10, so check node -v first.

npm create vite@latest my-app -- --template react
cd my-app
npm install

The template comes with Oxlint configured. You can keep it (it is very fast, see the comparison near the end), or remove it if you only want ESLint:

npm uninstall oxlint
rm .oxlintrc.json

If you already have a React project, skip this step. Everything below works the same in an existing Vite app, and the config ideas apply to other setups too.

Step 2: Install ESLint and the React Plugins

npm install --save-dev eslint @eslint/js globals eslint-plugin-react-hooks eslint-plugin-react-refresh
  • eslint: the linter itself.
  • @eslint/js: ESLint’s built-in recommended rules, such as no-unused-vars and no-undef.
  • globals: lists of global variables, so ESLint knows window and document exist in the browser.
  • eslint-plugin-react-hooks: the React team’s plugin. Version 7 enforces the Rules of Hooks, checks effect dependencies and includes React Compiler rules such as set-state-in-effect and purity.
  • eslint-plugin-react-refresh: warns when a file exports something that breaks Fast Refresh (hot reloading) in Vite.

ESLint is a development dependency because it only runs on your machine and in CI, never in the browser.

Step 3: Create eslint.config.js

Create eslint.config.js in the project root:

import js from '@eslint/js';
import globals from 'globals';
import reactHooks from 'eslint-plugin-react-hooks';
import { reactRefresh } from 'eslint-plugin-react-refresh';
import { defineConfig, globalIgnores } from 'eslint/config';

export default defineConfig([
  globalIgnores(['dist', 'coverage']),
  {
    files: ['**/*.{js,jsx}'],
    extends: [
      js.configs.recommended,
      reactHooks.configs.flat.recommended,
      reactRefresh.configs.vite(),
    ],
    languageOptions: {
      ecmaVersion: 'latest',
      globals: globals.browser,
      parserOptions: { ecmaFeatures: { jsx: true } },
    },
  },
]);
  • defineConfig() comes from ESLint itself and gives you type hints plus the extends key inside each config object.
  • globalIgnores() replaces the old .eslintignore file, which ESLint 10 no longer reads.
  • files: ['**/*.{js,jsx}'] matters. Flat config only lints .js, .mjs and .cjs files by default, so without a pattern that includes .jsx, your components are silently skipped.
  • reactHooks.configs.flat.recommended is the flat version of the hooks preset. The plain recommended key is the legacy format.
  • reactRefresh.configs.vite() allows constant exports such as export const API_URL, which Vite’s Fast Refresh supports.

Older Vite templates also added 'no-unused-vars': ['error', { varsIgnorePattern: '^[A-Z_]' }]. Leave it out. It existed because ESLint could not see that <Avatar /> uses the imported Avatar, but ESLint 10 tracks JSX references. With that pattern, a genuinely unused component import is hidden; without it, ESLint 10 reports only the imports you really don’t use.

Step 4: Run ESLint and Read the Results

To see what the config catches, here is a component with five common mistakes:

import { useEffect, useState } from 'react';
import Avatar from './Avatar';

export const API_URL = 'https://api.example.com';

export default function UserCard({ userId, showBio }) {
  const [user, setUser] = useState(null);
  const unused = 42;

  if (showBio) {
    const [bio, setBio] = useState('');
  }

  useEffect(() => {
    fetch(`${API_URL}/users/${userId}`)
      .then((res) => res.json())
      .then(setUser);
  }, []);

  useEffect(() => {
    setUser(null);
  }, [userId]);

  return <div className="card">{user?.name}</div>;
}

export function formatName(user) {
  return user.name.trim();
}

Run ESLint on the src folder:

npx eslint src

The output (paths shortened, and the long React Compiler explanation trimmed):

src/UserCard.jsx
   2:8   error    'Avatar' is defined but never used                       no-unused-vars
   8:9   error    'unused' is assigned a value but never used              no-unused-vars
  11:12  error    'bio' is assigned a value but never used                 no-unused-vars
  11:17  error    'setBio' is assigned a value but never used              no-unused-vars
  11:27  error    React Hook "useState" is called conditionally. React Hooks must be
                  called in the exact same order in every component render  react-hooks/rules-of-hooks
  18:6   warning  React Hook useEffect has a missing dependency: 'userId'.
                  Either include it or remove the dependency array          react-hooks/exhaustive-deps
  21:5   error    Error: Calling setState synchronously within an effect can trigger
                  cascading renders                                         react-hooks/set-state-in-effect
  27:17  error    Fast refresh only works when a file only exports components. Use a
                  new file to share constants or functions between components
                                                                            react-refresh/only-export-components

✖ 8 problems (7 errors, 1 warning)
  • Rules of Hooks: useState inside an if changes the hook order between renders, which breaks React’s state tracking.
  • Missing dependency: the first effect reads userId but runs only once, so it never refetches when the prop changes.
  • setState in an effect: a React Compiler rule from version 7 of the hooks plugin. Resetting state from an effect causes an extra render; React’s docs recommend deriving the value or resetting it with a key instead.
  • Fast Refresh: exporting the formatName function from a component file makes Vite reload the whole page instead of hot-swapping the component. Move helpers to their own file. The API_URL constant is allowed by the Vite preset.
  • Unused variables: including the Avatar import. In a separate Profile.jsx that renders <Avatar src={url} />, the same import is correctly not reported.

Step 5: Add React and Accessibility Rules (the ESLint 10 Catch)

The hooks plugin covers most real bugs, but many teams also want eslint-plugin-react (missing key props, unescaped entities, unsafe target="_blank" links) and eslint-plugin-jsx-a11y (missing alt text, click handlers without keyboard support). Both still declare ESLint 9 as their highest supported version, so a normal install fails:

$ npm install -D eslint-plugin-react
npm error code ERESOLVE
npm error ERESOLVE unable to resolve dependency tree
npm error Found: [email protected]
npm error Could not resolve dependency:
npm error peer eslint@"^3 || ^4 || ^5 || ^6 || ^7 || ^8 || ^9.7" from [email protected]

Forcing the install and using the plugin’s flat config with settings.react.version: 'detect' then crashes, because ESLint 10 removed the context.getFilename() method the plugin calls:

TypeError: Error while loading rule 'react/display-name': contextOrFilename.getFilename is not a function

A maintainer replied on the bug report in June 2026 that the plugin is not yet compatible with ESLint 10 and suggested staying on ESLint 9; an ESLint 10 compatibility pull request was still open when I checked. You have three practical options:

OptionWhat you getTrade-off
Skip eslint-plugin-reactHooks, Fast Refresh and core rules, which catch most bugsNo jsx-key or accessibility rules
Use @eslint-react/eslint-pluginA maintained React plugin built for ESLint 10 (missing keys, javascript: URLs and more)Different rule names; no accessibility rules
Use eslint-plugin-react with a compatibility wrapperThe classic rule set plus jsx-a11yUnsupported upstream until the plugin adds ESLint 10 support

Option A: @eslint-react/eslint-plugin

ESLint React requires ESLint 10 and installs without warnings:

npm install --save-dev @eslint-react/eslint-plugin
import js from '@eslint/js';
import globals from 'globals';
import eslintReact from '@eslint-react/eslint-plugin';
import reactHooks from 'eslint-plugin-react-hooks';
import { reactRefresh } from 'eslint-plugin-react-refresh';
import { defineConfig, globalIgnores } from 'eslint/config';

export default defineConfig([
  globalIgnores(['dist', 'coverage']),
  {
    files: ['**/*.{js,jsx}'],
    extends: [
      js.configs.recommended,
      eslintReact.configs.recommended,
      reactHooks.configs.flat.recommended,
      reactRefresh.configs.vite(),
    ],
    languageOptions: {
      ecmaVersion: 'latest',
      globals: globals.browser,
      parserOptions: { ecmaFeatures: { jsx: true } },
    },
  },
]);

On a test component with a list missing its key and a javascript:void(0) link it reported:

5:9  error    Missing 'key' for element when rendering list                    @eslint-react/no-missing-key
9:15 warning  Using a `javascript:` URL is a security risk and should be avoided @eslint-react/dom-no-script-url

Option B: eslint-plugin-react and jsx-a11y With a Compatibility Wrapper

Two changes make the classic plugins work with ESLint 10. First, tell npm to accept your ESLint version for these two packages by adding overrides to package.json (this is narrower than installing everything with --legacy-peer-deps):

{
  "overrides": {
    "eslint-plugin-react": { "eslint": "$eslint" },
    "eslint-plugin-jsx-a11y": { "eslint": "$eslint" }
  }
}
npm install --save-dev eslint-plugin-react eslint-plugin-jsx-a11y @eslint/compat

Then wrap the React plugin’s configs with fixupConfigRules() from ESLint’s official @eslint/compat package, which restores the removed context methods the plugin still calls:

import js from '@eslint/js';
import globals from 'globals';
import react from 'eslint-plugin-react';
import { fixupConfigRules } from '@eslint/compat';
import reactHooks from 'eslint-plugin-react-hooks';
import { reactRefresh } from 'eslint-plugin-react-refresh';
import jsxA11y from 'eslint-plugin-jsx-a11y';
import eslintConfigPrettier from 'eslint-config-prettier/flat';
import { defineConfig, globalIgnores } from 'eslint/config';

export default defineConfig([
  globalIgnores(['dist', 'coverage']),
  {
    files: ['**/*.{js,jsx}'],
    extends: [
      js.configs.recommended,
      fixupConfigRules(react.configs.flat.recommended),
      fixupConfigRules(react.configs.flat['jsx-runtime']),
      reactHooks.configs.flat.recommended,
      reactRefresh.configs.vite(),
      jsxA11y.flatConfigs.recommended,
    ],
    languageOptions: {
      ecmaVersion: 'latest',
      globals: globals.browser,
      parserOptions: { ecmaFeatures: { jsx: true } },
    },
    settings: { react: { version: 'detect' } },
    rules: {
      'react/prop-types': 'off',
    },
  },
  eslintConfigPrettier,
]);

The jsx-runtime preset turns off the old “React must be in scope” rules, which do not apply to React 17 and later. react/prop-types is off because prop types are not checked in React 19. The eslint-config-prettier line is explained in Step 7. On the test component, this config reported:

export default function TodoList({ todos, onSelect }) {
  return (
    <ul>
      {todos.map((todo) => (
        <li onClick={() => onSelect(todo.id)}>{todo.title}</li>
      ))}
      <img src="/empty.png" />
      <p>Don't forget to save</p>
      <a href="javascript:void(0)">Reset</a>
    </ul>
  );
}
5:9  error  Missing "key" prop for element in iterator                       react/jsx-key
5:9  error  Visible, non-interactive elements with click handlers must have
            at least one keyboard listener                                  jsx-a11y/click-events-have-key-events
5:9  error  Non-interactive elements should not be assigned mouse or
            keyboard event listeners                                        jsx-a11y/no-noninteractive-element-interactions
7:7  error  img elements must have an alt prop, either with meaningful text,
            or an empty string for decorative images                        jsx-a11y/alt-text
8:13 error  `'` can be escaped with `&apos;`, `&lsquo;`, `&#39;`, `&rsquo;` react/no-unescaped-entities
9:7  error  The href attribute requires a valid value to be accessible.      jsx-a11y/anchor-is-valid

✖ 6 problems (6 errors, 0 warnings)

I ran this config over all 410 files in the test project with no crashes. Without fixupConfigRules(), setting version: '19.3' instead of 'detect' also avoided the crash in my tests, but the wrapper is the safer fix. Remove both workarounds once the plugin officially supports ESLint 10.

Step 6: Add TypeScript Support

For TypeScript, install typescript-eslint. In a project from Vite’s react-ts template, the install fails because the template now uses TypeScript 7:

npm error Found: [email protected]
npm error Could not resolve dependency:
npm error peer typescript@">=4.8.4 <6.1.0" from [email protected]

TypeScript 7 is the new native compiler and ships without a programmatic API, which typescript-eslint needs. The TypeScript 7.0 announcement recommends running both versions side by side with npm aliases: tsc stays on TypeScript 7 for builds, while tools that import typescript get the 6.0 API. In package.json:

{
  "devDependencies": {
    "@typescript/native": "npm:typescript@^7.0.2",
    "typescript": "npm:@typescript/typescript6@^6.0.2"
  }
}
npm install
npm install --save-dev eslint @eslint/js globals typescript-eslint eslint-plugin-react-hooks eslint-plugin-react-refresh

After that, npx tsc -v printed Version 7.0.2, while typescript-eslint loaded TypeScript 6.0.3. If your project is on TypeScript 6 or earlier, skip the aliases. The config, with type-aware rules enabled:

import js from '@eslint/js';
import globals from 'globals';
import tseslint from 'typescript-eslint';
import reactHooks from 'eslint-plugin-react-hooks';
import { reactRefresh } from 'eslint-plugin-react-refresh';
import { defineConfig, globalIgnores } from 'eslint/config';

export default defineConfig([
  globalIgnores(['dist']),
  {
    files: ['**/*.{ts,tsx}'],
    extends: [
      js.configs.recommended,
      tseslint.configs.recommendedTypeChecked,
      reactHooks.configs.flat.recommended,
      reactRefresh.configs.vite(),
    ],
    languageOptions: {
      globals: globals.browser,
      parserOptions: {
        projectService: true,
        tsconfigRootDir: import.meta.dirname,
      },
    },
  },
]);

recommendedTypeChecked uses type information, so it catches bugs plain ESLint cannot see. projectService: true finds the right tsconfig for each file automatically. On this component:

import { useEffect, useState } from 'react';

type User = { id: number; name: string };

async function loadUser(id: number): Promise<User> {
  const res = await fetch(`/api/users/${id}`);
  return res.json();
}

export default function UserBadge({ id }: { id: number }) {
  const [user, setUser] = useState<User | null>(null);
  const [debug, setDebug] = useState<any>(null);

  useEffect(() => {
    loadUser(id).then(setUser);
  }, [id]);

  return <span>{user?.name}</span>;
}
7:3   error  Unsafe return of a value of type `Promise<any>`                @typescript-eslint/no-unsafe-return
12:10 error  Unsafe array destructuring of a tuple element with an `any` value @typescript-eslint/no-unsafe-assignment
12:10 error  'debug' is assigned a value but never used                       @typescript-eslint/no-unused-vars
12:17 error  'setDebug' is assigned a value but never used                    @typescript-eslint/no-unused-vars
12:38 error  Unexpected any. Specify a different type                         @typescript-eslint/no-explicit-any
15:5  error  Promises must be awaited, end with a call to .catch, end with a call
             to .then with a rejection handler or be explicitly marked as ignored
             with the `void` operator                                         @typescript-eslint/no-floating-promises

✖ 6 problems (6 errors, 0 warnings)

The floating promise is the important one: if loadUser fails, nothing handles the error. After typing the JSON result, adding .catch(console.error) and removing the unused state, ESLint reported no problems and npm run build (TypeScript 7 plus Vite) succeeded. Type-aware linting of this small project took about 1.6 seconds. For more on typing React forms, see form validation in TypeScript with Zod and React Hook Form.

Step 7: Use Prettier for Formatting

Let ESLint find bugs and let Prettier format code. Install Prettier and eslint-config-prettier, which turns off any ESLint rules that would conflict with Prettier’s formatting:

npm install --save-dev prettier eslint-config-prettier

Import eslint-config-prettier/flat and put it last in the config array, as in the full config in Step 5, so it can override earlier configs. You can check that nothing conflicts with its built-in tool; for the full config above it printed No rules that are unnecessary or conflict with Prettier were found.

npx eslint-config-prettier src/main.jsx

Add a .prettierrc.json with your preferences, for example { "singleQuote": true }, and run npx prettier --check . in CI. You may see older guides that add eslint-plugin-prettier to run Prettier as an ESLint rule. Prettier’s own docs say this is generally not recommended: it fills the editor with red squiggles for formatting, and it is slower than running Prettier directly.

Step 8: Add npm Scripts and Turn On Caching

{
  "scripts": {
    "lint": "eslint . --cache",
    "lint:fix": "eslint . --cache --fix",
    "format": "prettier --write ."
  }
}

eslint . lints the whole project; the files patterns and globalIgnores in your config decide what is included, so you no longer need --ext or long globs. --fix applies safe automatic fixes: in the Vite template, it added rel="noreferrer" to six target="_blank" links flagged by react/jsx-no-target-blank. Problems that need a human decision, such as a missing dependency, are left for you.

--cache stores results in .eslintcache and only re-lints changed files. Add that file to .gitignore. On 400 generated component files with the basic config (Apple M2, timings include npx startup):

RunTime
Without cache2.4 s
First run with –cache (builds the cache)2.5 s
Cached run, no changes0.57 s
Cached run after editing one file0.66 s

Step 9: Run ESLint in CI With GitHub Actions

Linting in CI stops problems from reaching your main branch. Save this as .github/workflows/lint.yml:

name: Lint

on:
  push:
    branches: [main]
  pull_request:

jobs:
  lint:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v7
      - uses: actions/setup-node@v7
        with:
          node-version: 24
          cache: npm
      - run: npm ci
      - run: npx eslint . --max-warnings 0
      - run: npx prettier --check .

--max-warnings 0 makes warnings such as missing effect dependencies fail the build too; drop it if you only want errors to block merges. The workflow passed actionlint. For a full pipeline that also builds and deploys, see building a CI/CD pipeline with Docker.

Step 10: Set Up ESLint in VS Code

Install the ESLint extension by Microsoft. It picks up eslint.config.js automatically. To fix problems on save, add this to your workspace .vscode/settings.json:

{
  "editor.codeActionsOnSave": {
    "source.fixAll.eslint": "explicit"
  },
  "editor.formatOnSave": true,
  "editor.defaultFormatter": "esbenp.prettier-vscode"
}
  • Use "explicit" rather than the old true value; VS Code changed this setting to string values.
  • You no longer need eslint.validate for JSX or TypeScript files. The extension probes javascriptreact and typescriptreact files by default.
  • The eslint.useFlatConfig setting is ignored with ESLint 10, since flat config is the only format.
  • If the extension shows nothing, open the ESLint output panel. A common cause is the editor running an older Node.js than ESLint 10 needs (20.19 or later).

Migrating an Old .eslintrc Config

If your project still has .eslintrc.json or .eslintrc.js, ESLint 10 ignores it. ESLint’s migration tool converts it for you:

npx @eslint/migrate-config .eslintrc.json

I ran it (version 3.0.4) on a typical React .eslintrc.json with eslint-plugin-react, react-hooks and an .eslintignore. It wrote eslint.config.mjs, imported the ignore patterns and listed the packages to install. The result needed three fixes before it worked:

  1. No .jsx files were linted. ESLint stopped with “all of the files matching the glob pattern “src” are ignored” until I added files: ["**/*.{js,jsx}"].
  2. The leftover .eslintignore triggered a warning: ESLintIgnoreWarning: The ".eslintignore" file is no longer supported. Delete it once its patterns are in the new config.
  3. Every JSX line reported 'React' must be in scope when using JSX, because the old config predates the automatic JSX runtime. Adding the jsx-runtime preset fixed it.

The generated file uses FlatCompat and fixupPluginRules shims to load old-style presets. It works, but once it runs, replacing those shims with the plugins’ native flat configs (as in Step 3) makes the file shorter and easier to maintain.

Sharing One ESLint Config Across Projects

To keep several React apps on the same rules, publish your config as a package that exports a flat config array:

import js from '@eslint/js';
import globals from 'globals';
import reactHooks from 'eslint-plugin-react-hooks';

export default [
  js.configs.recommended,
  reactHooks.configs.flat.recommended,
  {
    files: ['**/*.{js,jsx}'],
    languageOptions: {
      globals: globals.browser,
      parserOptions: { ecmaFeatures: { jsx: true } },
    },
    rules: {
      'no-console': ['warn', { allow: ['warn', 'error'] }],
    },
  },
];
{
  "name": "@acme/eslint-config",
  "version": "1.0.0",
  "type": "module",
  "exports": "./index.js",
  "peerDependencies": {
    "eslint": "^10.0.0"
  },
  "dependencies": {
    "@eslint/js": "^10.0.1",
    "globals": "^17.14.0",
    "eslint-plugin-react-hooks": "^7.1.1"
  }
}

ESLint’s shareable config docs say plugins and parsers your config uses belong in dependencies, with eslint as a peer dependency. I first listed the plugin as a peer dependency, and the consuming project failed with Cannot find package '@eslint/js'. After moving the imports to dependencies, each project only needs:

import acme from '@acme/eslint-config';
import { defineConfig } from 'eslint/config';

export default defineConfig([
  {
    files: ['**/*.{js,jsx}'],
    extends: [acme],
  },
]);

Linting a test app with this shared config reported the expected no-console warning. In a monorepo, the same package can live in a workspace folder; see monorepo vs multi-repo vs monolith for when that structure makes sense.

ESLint vs Oxlint for React

Since Vite now starts you with Oxlint, it is worth knowing how the two compare. On the same 400 files, Oxlint 1.94 with the template’s config took about 0.05 seconds, while ESLint with the full config from Step 5 took 2.3 to 3.0 seconds. That is not a like-for-like comparison, because the rule sets differ, but the gap is large. On my buggy component, Oxlint caught the conditional hook, the missing dependency, the unused variables, the Fast Refresh export and set-state-in-effect.

ESLintOxlint
SpeedSeconds on large projects; use –cacheMuch faster (written in Rust)
React Hooks rulesOfficial eslint-plugin-react-hooksBuilt-in ports of the main rules
Plugin ecosystemVery large, including jsx-a11y and type-aware typescript-eslint rulesBuilt-in rules; fewer third-party plugins
Configeslint.config.js.oxlintrc.json

Many teams run both: Oxlint for instant feedback on every save or commit, and ESLint in CI for the rules Oxlint does not have. If you start from Vite and only need hooks rules, Oxlint alone may be enough.

Troubleshooting ESLint in React Projects

SymptomCauseFix
“all of the files matching the glob pattern … are ignored”No files pattern matches .jsx or .tsxAdd files: [‘**/*.{js,jsx}’] (or ts,tsx)
.eslintrc changes have no effectESLint 10 does not read .eslintrc filesMigrate to eslint.config.js
ESLintIgnoreWarning about .eslintignoreIgnore files were replaced by configMove patterns into globalIgnores() and delete the file
npm ERESOLVE when installing eslint-plugin-react or jsx-a11yTheir peer range stops at ESLint 9Use overrides (Step 5) or @eslint-react/eslint-plugin
contextOrFilename.getFilename is not a functioneslint-plugin-react calls an API removed in ESLint 10Wrap its configs in fixupConfigRules()
npm ERESOLVE for typescript-eslint and typescript@7TypeScript 7 has no API yetAlias typescript to @typescript/typescript6 (Step 6)
‘React’ must be in scope when using JSXOld config without the automatic JSX runtimeAdd react.configs.flat[‘jsx-runtime’]
Unused component imports are not reportedAn old varsIgnorePattern: ‘^[A-Z_]’ ruleRemove it; ESLint 10 tracks JSX references
Cannot find package from a shared configIts plugins are peer dependenciesList plugins in the shared config’s dependencies
No errors shown in VS CodeExtension cannot load ESLint or uses old Node.jsCheck the ESLint output panel; use Node.js 20.19+

Conclusion

A modern React ESLint setup is one eslint.config.js file: the core recommended rules, the React Hooks plugin, the React Refresh preset and a files pattern that includes your component files. Add typescript-eslint for TypeScript, eslint-config-prettier if you use Prettier, --cache for speed and a CI job to enforce it. Most of the friction in 2026 comes from version changes rather than ESLint itself: .eslintrc is gone, the classic React plugin needs a workaround on ESLint 10, and TypeScript 7 needs the TypeScript 6 alias for linting. Check those first when a tutorial’s config does not work.

FAQs

Does ESLint 10 still support .eslintrc files?

No. ESLint 10, released on February 6, 2026, removed the legacy .eslintrc format. Use eslint.config.js, and convert an old file with npx @eslint/migrate-config .eslintrc.json.

Which ESLint plugins do I need for React?

At minimum eslint-plugin-react-hooks, which enforces the Rules of Hooks and effect dependencies. For Vite, add eslint-plugin-react-refresh. eslint-plugin-react, eslint-plugin-jsx-a11y or @eslint-react/eslint-plugin are optional extras for JSX and accessibility rules.

Can I use eslint-plugin-react with ESLint 10?

Not officially yet. A normal install fails with a peer dependency error. It works in practice if you add an npm overrides entry and wrap its configs with fixupConfigRules from @eslint/compat, or you can switch to @eslint-react/eslint-plugin, which supports ESLint 10.

Why does Vite use Oxlint instead of ESLint now?

Recent create-vite React templates ship Oxlint because it is much faster and covers the key React Hooks and Fast Refresh rules. You can keep it, replace it with ESLint, or run both.

How do I use typescript-eslint with TypeScript 7?

TypeScript 7 has no compiler API yet, so typescript-eslint needs TypeScript 6. Alias typescript to npm:@typescript/typescript6 and install TypeScript 7 under another name, such as @typescript/native, so tsc still runs version 7.

Should I use eslint-plugin-prettier?

Usually not. Prettier recommends running Prettier directly and using eslint-config-prettier to turn off conflicting ESLint rules. Running Prettier as an ESLint rule is slower and fills the editor with formatting warnings.

Why is ESLint not linting my .jsx files?

Flat config only lints .js, .mjs and .cjs files unless a config object has a files pattern that matches other extensions. Add files: [‘**/*.{js,jsx}’] to the config object that holds your React rules.

Snehasish Konger
Developed @scientyficworld.org | Technical writer @Nected | Content Developer
Connect with Snehasish Konger

On This page

Take a Pause with Intervals

A Sunday letter on building, writing, and thinking deeper as a developer — short, honest, and worth your time.

Snehasish Konger profile photo

"Hey there — I'm Snehasish. Hope this post saved you some head-scratching time! I've spent years turning technical chaos into clarity, and I'm here to be your guide through the maze of modern tech. Stick around for more lightbulb moments — we're just getting started."

Related Posts