Upgrade to ESLint 10 with eslint-plugin-import
eslint-plugin-import has no ESLint 10 release (peer ^9), so installs fail with ERESOLVE. Swap it in one line with eslint-plugin-import-next, or use import-x.
eslint-plugin-import 2.32.0 is the latest release, and its eslint peer range stops at ^9. Install ESLint 10 next to it and npm refuses; pnpm with strict peers and Yarn complain the same way. Support for ESLint 10 is merged on its main branch (import-js/eslint-plugin-import#3230, merged 2026-06-29) but has not been released.
Covers ESLint 10 with flat config. Versions and dates were read from the npm registry on 2026-11-20. Last updated 2026-11-20. We maintain eslint-plugin-import-next, so read its rows as claims by an interested party.
The error
Captured on 2026-11-20 with npm 11.6.2 and Node 24.12.0, running npm install --save-dev eslint@10.14.0 eslint-plugin-import@2.32.0 in an empty project:
npm error code ERESOLVE
npm error ERESOLVE unable to resolve dependency tree
npm error While resolving: your-app@1.0.0
npm error Found: eslint@10.14.0
npm error node_modules/eslint
npm error dev eslint@"10.14.0" from the root project
npm error Could not resolve dependency:
npm error peer eslint@"^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8 || ^9" from eslint-plugin-import@2.32.0
npm error node_modules/eslint-plugin-import
npm error dev eslint-plugin-import@"2.32.0" from the root project
npm error Fix the upstream dependency conflict, or retry
npm error this command with --force or --legacy-peer-depsYour options
- Wait. If the upstream release is close, the cheapest fix is no change. When it ships, this page is out of date for you.
- Keep
eslint-plugin-importand override the peer (npm install --legacy-peer-deps, oroverridesinpackage.json). Reports from other projects say most rules load on ESLint 10 and three crash:no-default-export,no-named-exportandunambiguous(import-js#3227, OpenAEV#8480). We could not reproduce it: on 2026-11-20, with 2.32.0 installed under--legacy-peer-depsnext to ESLint 10.14.0, every one of its 46 rules ran on a two-line module without throwing,no-default-export,no-named-exportandunambiguousincluded. The crash may depend on the code being linted or on the ESLint 10 patch version, so run your own repository before you rely on either result. - Swap to
eslint-plugin-import-next. Same rule names, sameimport/*settings, one changed import line. Below. - Swap to
eslint-plugin-import-x. Maintained, supports ESLint 10, but it renames everything toimport-x/*. See when import-x is the better choice.
The one-line swap
npm uninstall eslint-plugin-import
npm install --save-dev eslint-plugin-import-nextIn eslint.config.js, change the import line and leave the rest alone:
- import importPlugin from 'eslint-plugin-import';
+ import importPlugin from 'eslint-plugin-import-next';
export default [
importPlugin.flatConfigs.recommended,
importPlugin.flatConfigs.typescript,
];If you register the rules yourself instead of using flatConfigs, register the plugin under the same import key:
import importPlugin from 'eslint-plugin-import-next';
export default [
{
plugins: { import: importPlugin },
settings: { 'import/resolver': { node: { extensions: ['.js', '.ts'] } } },
rules: { 'import/no-cycle': 'error', 'import/order': 'warn' },
},
];A shared config you do not control
If the plugin comes in through a shared config (eslint-config-airbnb-extended, @wordpress/eslint-plugin, eslint-plugin-github and similar) that imports eslint-plugin-import itself, point that name at ours with an npm alias:
We ran this on 2026-11-20 with npm 11.6.2 and ESLint 10.14.0. A package that depends on eslint-plugin-import@^2.32.0, installed with the override below, resolved to eslint-plugin-import@npm:eslint-plugin-import-next@4.1.3, npm install finished without ERESOLVE, and eslint reported import/no-duplicates through the shared config's flatConfigs.recommended. We did not run pnpm or Yarn; they take the same idea under pnpm.overrides and resolutions.
{
"overrides": {
"eslint-plugin-import": "npm:eslint-plugin-import-next@^4.1.1"
}
}The shared config must read only what flatConfigs exposes: the seven keys recommended, errors, warnings, react, react-native, electron and typescript. A shared config that extends the eslintrc preset (plugin:import/recommended) will not work, because those presets are not provided.
What stays the same
- Rule names. The plugin registers as
import, soimport/no-cycle,import/orderand the rest keep their IDs, and so do youreslint-disable import/...comments. flatConfigs. The same seven keys as 2.32.0, with the same rule IDs, severities,settingsandlanguageOptions. A test in the repository compares each key with an installedeslint-plugin-import2.32.0 and lints a fixture through both, expecting the same findings by rule, line and severity.- Defaults. Options you leave out behave as upstream's do. Since 4.1.3 that includes
consistent-type-specifier-style, which with no options isprefer-top-level, as ineslint-plugin-import2.32.0; pass'prefer-inline'for the other style. - Settings. These
import/*keys are read, with the meaning they have ineslint-plugin-import:
| Setting | Read by |
|---|---|
import/resolver, import/resolve | every rule that resolves an import (no-unresolved, no-duplicates, no-extraneous-dependencies, no-cycle, extensions, named, namespace, default, export and others). import/resolve is read only when import/resolver is absent, as upstream does |
import/extensions, import/parsers, import/ignore | the rules that read other modules (named, namespace, default, export, no-deprecated, no-named-as-default, no-named-as-default-member) |
import/core-modules, import/external-module-folders, import/internal-regex | order (and import/external-module-folders in no-cycle) |
import/node-version | enforce-node-protocol-usage |
import/docstyle | the comment styles (jsdoc by default) the module reader accepts when it looks for @deprecated |
Any import/* key that is not in that table is not read. The plugin does not read import-x/* keys at all.
- Resolvers.
node(itsextensionsandpaths),typescript(oreslint-import-resolver-typescript) andcustom-aliassettings are modelled, in the order you list them, and a specifier the first one misses goes to the next. They are approximated, not invoked: you do not need the resolver packages installed for the plugin to honour the setting. Any other resolver (webpack, a custom one) is treated as the default resolver, so an alias that only webpack knows can still show up as unresolved. - Versions. Peer
eslintis^8.40.0 || ^9.0.0 || ^10.0.0. Node is^20.19.0 || ^22.13.0 || >=24.
What differs: the 5% of upstream's tests that fail
eslint-plugin-import-next implements all 45 rules that eslint-plugin-import's test suite covers. Graded by that suite's own cases, it passes 2,035 of 2,135 (95.3%), measured 2026-11-19 on 4.1.0. A valid case passes when the rule reports nothing and an invalid case passes when the rule reports exactly the expected number of problems; messages, positions and fixes are not compared. Only cases that eslint-plugin-import itself passes in the same harness are graded, which leaves out 682 of the 2,817 captured. Most of those are 490 cases that need the babel-eslint parser. 24 rules pass every graded case.
The 100 failing cases, by rule:
| Rule | Fails | Of graded | What goes wrong |
|---|---|---|---|
no-useless-path-segments | 28 | 94 | Misses require("./bar/index") and ./test-module/ style paths (14 of the 28 involve require; 22 set noUselessIndex); reports 2 valid cases |
no-commonjs | 11 | 45 | Reports 10 valid cases: require inside a function, behind && or if, in try/catch, with a non-literal argument |
dynamic-import-chunkname | 9 | 102 | Misses chunk-name comments when importFunctions names a custom function |
no-cycle | 8 | 102 | Misses cycles through external folders and some dynamic import() cases |
max-dependencies | 6 | 11 | Misses cases that count require calls and repeated imports |
no-anonymous-default-export | 6 | 48 | Misses export default of a literal, array, object or new expression when no options are given |
no-internal-modules | 6 | 44 | Reports 4 valid cases with forbid globs; misses 2 |
no-unresolved | 6 | 100 | Reports 2 valid cases: require("./missing") under default options, which upstream ignores unless commonjs: true; misses 3; one count differs |
no-amd | 4 | 15 | Reports 4 valid cases: define and require([...]) calls nested in functions or with odd arguments |
extensions | 3 | 70 | Misses index.js and TypeScript declare-file cases |
export, exports-last, no-mutable-exports, order | 2 each | export and no-mutable-exports miss TypeScript merging and export default of a mutable binding; order reports 2 valid cases with alphabetize and named or cjsExports options | |
namespace, no-import-module-exports, no-named-export, no-relative-packages, no-restricted-paths | 1 each | One case each: a missed finding, one valid case reported, or a different count |
Totals: 71 invalid cases go unreported (a missed finding), 25 valid cases are reported (a new finding), and 4 report a different number of times. The 25 are the ones that can fail your CI after the swap, and they sit in no-commonjs, no-internal-modules, no-amd, no-unresolved, no-useless-path-segments, order and no-import-module-exports. If you do not enable those rules you will not meet them; a codebase with no CommonJS is not exempt (no-internal-modules reports one valid export * from case). Every failing case is listed with its expected and reported counts in the measurement file.
Differences the test suite does not show, from a 5-file fixture run on 4.1.0 and checked again on 2026-11-20 against the 4.1.4 source, except the last bullet:
no-duplicatesflags./otherand./other.tsas the same module (it resolves TypeScript extensions by default); 2.32.0 did not. That is a new finding on TypeScript code that has both spellings.- A multi-line
import {...} from './dep'is reported on the statement's first line, not on thefromline, and columns differ, so a disable comment placed above thefromline stops matching. exportskips a duplicateexport interface T(legal TypeScript declaration merging); 2.32.0 reports it. Deliberate.no-unused-modulesrejects itsunusedExportsoption instead of ignoring it.- Only the
no-duplicatesandno-extraneous-dependenciesmessages were rewritten to upstream's one-line form in 4.1.1. Anything that matches on message text for other rules should be checked. - 4.1.0 reported 129 false positives (58
no-duplicates, 71no-extraneous-dependencies) on a lint-clean svelte and docusaurus monorepo that 2.32.0 reports nothing on. 4.1.1 fixed both and the changelog records zero findings on that repo. That is one repository; run your own.
When import-x is the better choice
eslint-plugin-import-x is the fork most projects chose. It supports ESLint 10 (peer ^8.57.0 || ^9.0.0 || ^10.0.0), and every project we found that moved off eslint-plugin-import for ESLint 10 chose it. Pick it when:
- You need Node 18. Its
enginesis^18.18.0 || ^20.9.0 || >=21.1.0. Ours starts at 20.19, which is also ESLint 10's own floor, so on ESLint 10 alone the gap is only Node versions below 20.19 on older ESLint. - You still use eslintrc configs. We provide flat configs only. Its source tree has both
src/config/recommended.tsand asrc/config/flat/directory. - You want its newer resolver interface. It reads
import-x/resolver-nextas well as the legacyimport-x/resolver. - You are happy to rename. It reads only
import-x/*settings and registers rules asimport-x/*.import/resolver,import/extensionsand the others must be renamed, and so must everyeslint-disable import/...comment. Mocha's open pull request (mochajs/mocha#6478) does that and drops two settings. - You want the larger user base. Last week's npm downloads, 2026-11-12 to 2026-11-18:
eslint-plugin-import85,299,469,eslint-plugin-import-x10,204,049,eslint-plugin-import-next7,826. First published: import-x 2024-03-11, import-next 2025-12-30. - You want the two plugins side by side while you migrate. Different prefixes cannot collide.
We have not run eslint-plugin-import-x against eslint-plugin-import's test suite, so we cannot tell you which is closer to upstream. The one difference we checked in its source is the settings prefix.
Verify it on your repo
Run your lint before and after, and compare what is reported. Do the "before" run on the ESLint and plugin you have today, before upgrading, so a rule that crashes on ESLint 10 does not get in the way.
# 1. before: your current setup
npx eslint . -f json -o before.json
# 2. swap the plugin (and upgrade ESLint), then
npx eslint . -f json -o after.json
# 3. confirm the import rules are active under the same IDs
npx eslint --print-config src/index.ts | grep '"import/'Compare by rule, file and line. Columns and message text differ for some rules, so do not compare them. If you moved to eslint-plugin-import-x, the script reads its import-x/* findings as import/*. Save this as compare-import.mjs:
import { readFileSync } from 'node:fs';
// import-x registers as `import-x/*`; read both prefixes as `import/*`.
const rule = (m) => m.ruleId?.replace(/^import-x\//, 'import/');
const key = (f, m) =>
`${rule(m)}\t${f.filePath.replace(process.cwd() + '/', '')}:${m.line}`;
const load = (file) => {
const found = new Map();
for (const f of JSON.parse(readFileSync(file, 'utf8')))
for (const m of f.messages)
if (rule(m)?.startsWith('import/'))
found.set(key(f, m), (found.get(key(f, m)) ?? 0) + 1);
return found;
};
const [before, after] = [load(process.argv[2]), load(process.argv[3])];
const only = (a, b) => [...a.keys()].filter((k) => !b.has(k));
const changed = (a, b) =>
[...a].filter(([k, n]) => b.has(k) && b.get(k) !== n);
const total = (m) => [...m.values()].reduce((a, b) => a + b, 0);
console.log(`before: ${total(before)} after: ${total(after)}`);
for (const k of only(before, after)) console.log(`missing after ${k}`);
for (const k of only(after, before)) console.log(`new after ${k}`);
for (const [k, n] of changed(before, after))
console.log(`count ${n} -> ${after.get(k)} ${k}`);
process.exitCode =
only(before, after).length +
only(after, before).length +
changed(before, after).length
? 1
: 0;node compare-import.mjs before.json after.jsonEmpty output after the totals line means the same findings in the same places, the same number of times. A new after line is the case to read first: check it against the table above, and if the rule is not on that list, open an issue with the file. A false positive is a bug here.
Building secure JavaScript with Interlace? Star the repo to get new rules and CWE coverage as we ship them — or follow the AI-code-security benchmarks behind them.
NestJS security linting: ESLint and oxlint on Nest 12
Lint a NestJS 12 app for missing guards, open CORS, unguarded Swagger and unsafe uploads with eslint-plugin-nestjs-security on ESLint 10 or oxlint, with the configs we ran and what each reported.
eslint-plugin-react on ESLint 10: getFilename is not a function
ESLint 10 breaks eslint-plugin-react 7.37.5 with 'contextOrFilename.getFilename is not a function' under settings.react.version 'detect'. Pin the version, or move to @eslint-react or react-x.