eslint-plugin-import-x
March 11, 2026 · View on GitHub
4.16.2
Patch Changes
-
#457
1da4043Thanks @SukkaW! - Make theno-unused-modulesrule no-op on ESLint 10 or later for now before we can implement an alternative. A warning message about this behavior is added, and can be suppressed with the newsuppressMissingFileEnumeratorAPIWarningrule option (import-x/no-unused-modules: ['error', { suppressMissingFileEnumeratorAPIWarning: true }]). -
#450
a51be0fThanks @andrewgaun! - fix(deps): Bumping minimatch 10 version to avoid dependency with a critical vulnerabilityUpdating the minimum
minimatch10 version to 10.1.2 which updates a dependency (@isaacs/brace-expansion) with a critical vulnerability. See https://github.com/advisories/GHSA-7h2j-956f-4vf2 -
#466
b669acaThanks @SukkaW! - Makeeslint-plugin-import-xcompatible with ESLint'sdefineConfig -
#434
a3aae61Thanks @stepankuzmin! - fix(deps): replace type-fest with @package-json/typesPackageJson types are imported in published declaration files (lib/rules/no-extraneous-dependencies.d.ts and lib/utils/read-pkg-up.d.ts), which causes TypeScript compilation errors for consumers who don't have skipLibCheck enabled. Replacing type-fest with the smaller @package-json/types package ensures the types are available to all consumers while reducing bundle size.
-
#458
60312eeThanks @SukkaW! - Bump peer deps version range to include ESLint 10 support -
#443
b416a8aThanks @baevm! - consistent-type-specifier-style: Add exception for TS resolution-mode import attributes -
#454
d3f8d67Thanks @SukkaW! - First step toward ESLint 10 support:sourceTypedetermination now preferscontext.languageOptionswhen possible- Ensure
context.parserOptionsno longer results in crashes with ESLint 10 - Merge
getParserandgetParserPathimplementations into onegetParserOrPath
-
#406
d0a7816Thanks @marcalexiei! - fix(package): remove config and rules exports pointing to empty files
4.16.1
Patch Changes
-
#399
33f07b4Thanks @JounQin! - fix: should only usecontext.physicalFilenameas fallback instead of main source -
#400
34adb40Thanks @renovate! - chore(deps): bumpstable-hash-xv0.2
4.16.0
Minor Changes
- #386
1c8b9aeThanks @Rel1cx and @JounQin! - feat: portreact-x/prefer-react-namespace-importintoprefer-namespace-import
Patch Changes
-
#393
14cb948Thanks @lnhrdt and @JounQin! - fix(extensions): always calculatefixoption -
#388
1089d9fThanks @JounQin! - fix: takecontext.cwdinto account for cache key -
#390
8ca9272Thanks @JounQin, @scytacki and @arcanis! - fix: pnp issue when used in a monorepo
4.15.2
Patch Changes
-
#378
cdb95baThanks @error-four-o-four! - chore: adopt newdeprecated: DeprecatedInfometa rule option -
#383
738a7cfThanks @JounQin! - fix: get npm client and install command correctly -
#382
d536756Thanks @JounQin! - chore: bumpunrs-resolvertov1.9.0, it'll fallback tonapi-postinstallcheck at runtime
4.15.1
Patch Changes
-
#373
90ec1f1Thanks @JounQin! - chore: migratestable-hashtostable-hash-x -
#371
4f97a1aThanks @dword-design and @JounQin! - fix: takecontext.cwdinto account for glob options of rulesno-extraneous-dependenciesandno-unassigned-import -
#371
4f97a1aThanks @JounQin! - fix: enablenocomment: truefor glob options of rulesno-import-module-exportsandno-namespace -
#368
74a16c5Thanks @JoseGoncalves! - fix: droplanguageOptionsconfig fromflat/recommended
4.15.0
Minor Changes
4.14.2
Patch Changes
-
#360
3a3f5f8Thanks @JounQin! - fix: try/catchenumerator.iterateFilesgracefully -
#357
46c8bc6Thanks @JounQin! - chore(deps): bump@typescript-eslint/utilsandunrs-resolver
4.14.1
Patch Changes
4.14.0
Minor Changes
-
#272
43cdd21Thanks @SukkaW and @JounQin! - feat: map legacy node resolver to the new one with fallback support -
#350
12a7cdaThanks @43081j! - Expose flat configs inconfigsobject to allow use of ESLintextends
Patch Changes
- #352
3bc48fcThanks @JounQin! - fix: enablenocommentglob option for ruleno-unassigned-import'sallowoption
4.13.3
Patch Changes
- #348
f949929Thanks @JounQin! - fix(types): exportedimportXshould also haveflatConfigsas property
4.13.2
Patch Changes
-
#344
2c007d0Thanks @JounQin! - fix: share same plugin reference for default export -
#346
2991f2eThanks @JounQin! - fix: ruledynamic-import-chunknamecrash due to ts migration -
#342
a55dcc7Thanks @JounQin! - fix(deps): bumpeslint-import-contextto v0.1.5
4.13.1
Patch Changes
4.13.0
Minor Changes
- #335
371ebeeThanks @JounQin! - feat: integrateeslint-import-contextto get rule context without additional params
4.12.2
Patch Changes
4.12.1
Patch Changes
4.12.0
Minor Changes
4.11.1
Patch Changes
4.11.0
Minor Changes
4.10.6
Patch Changes
4.10.5
Patch Changes
4.10.4
Patch Changes
-
#299
bf50a4dThanks @renovate! - chore(deps): bump@typescript-eslint/utilsto v8.30 -
#297
9769f3cThanks @JounQin! - fix: support run withnode --eval
4.10.3
Patch Changes
- #292
1342127Thanks @JounQin! - refactor: remove unnecessary check forpnpapibecauseunrs-resolveralready handles it
4.10.2
Patch Changes
4.10.1
Patch Changes
4.10.0
Minor Changes
Patch Changes
4.9.4
Patch Changes
4.9.3
Patch Changes
- #263
c0046a9Thanks @JounQin! - chore: migrate to rebrandingunrs-resolverwith new targets supported:i686-pc-windows-msvcarmv7-unknown-linux-musleabihfpowerpc64le-unknown-linux-gnus390x-unknown-linux-gnu
4.9.2
Patch Changes
4.9.1
Patch Changes
4.9.0
Minor Changes
- #248
6940b14Thanks @TrevorBurnham! - feat: port allorderrule new options from upstream
4.8.1
Patch Changes
4.8.0
Minor Changes
4.7.2
Patch Changes
4.7.1
Patch Changes
- #243
5bc8976Thanks @JounQin! - fix: userspack-resolverfork for pnp support
4.7.0
Minor Changes
-
#237
53b316cThanks @JounQin! - feat: migrateenhanced-resolvetooxc-resolver -
#214
091d2daThanks @mrginglymus! - Improve windows support
Patch Changes
-
#238
c8a388dThanks @JounQin! - fix: change defaultconditionsandmainFieldsdefaultshould be last matched,moduleshould be inmainFields.
4.6.1
Patch Changes
- #211
be9c3e8Thanks @mrginglymus! - Fix enhanced-resolve dependency
4.6.0
Minor Changes
-
#209
46d2360Thanks @SukkaW! - Wheneslint-plugin-import-xwas forked fromeslint-plugin-import, we copied over the default resolver (which iseslint-import-resolver-node) as well. However, this resolver doesn't supportsexportsin thepackage.jsonfile, and the current maintainer of theeslint-import-resolver-node(ljharb) doesn't have the time implementing this feature and he locked the issue https://github.com/import-js/eslint-plugin-import/issues/1810.So we decided to implement our own resolver that "just works". The new resolver is built upon the
enhanced-resolvethat implements the full Node.js Resolver Algorithm. The new resolver only implements the import resolver interface v3, which means you can only use it with ESLint Flat config. For more details about the import resolver interface v3, please check out #192.In the next major version of
eslint-plugin-import-x, we will remove theeslint-import-resolver-nodeand use this new resolver by default. In the meantime, you can try out this new resolver by setting theimport-x/resolver-nextoption in youreslint.config.jsfile:// eslint.config.js const eslintPluginImportX = require('eslint-plugin-import-x'); const { createNodeResolver } = eslintPluginImportX; module.exports = { plugins: { 'import-x': eslintPluginImportX, }, settings: { 'import-x/resolver-next': [ // This is the new resolver we are introducing createNodeResolver({ /** * The allowed extensions the resolver will attempt to find when resolving a module * By default it uses a relaxed extension list to search for both ESM and CJS modules * You can customize this list to fit your needs * * @default ['.mjs', '.cjs', '.js', '.json', '.node'] */ extensions?: string[]; /** * Optional, the import conditions the resolver will used when reading the exports map from "package.json" * By default it uses a relaxed condition list to search for both ESM and CJS modules * You can customize this list to fit your needs * * @default ['default', 'module', 'import', 'require'] */ conditions: ['default', 'module', 'import', 'require'], // You can pass more options here, see the enhanced-resolve documentation for more details // https://github.com/webpack/enhanced-resolve/tree/v5.17.1?tab=readme-ov-file#resolver-options }), // you can add more resolvers down below require('eslint-import-resolver-typescript').createTypeScriptImportResolver( /** options of eslint-import-resolver-typescript */ ) ], }, };We do not plan to implement reading
baseUrlandpathsfrom thetsconfig.jsonfile in this resolver. If you need this feature, please checkout eslint-import-resolver-typescript (also powered byenhanced-resolve), eslint-import-resolver-oxc (powered byoxc-resolver), eslint-import-resolver-next (also powered byoxc-resolver), or other similar resolvers.
Patch Changes
- #206
449738fThanks @privatenumber! - insert type prefix without new line
4.5.1
Patch Changes
-
#198
ac6d2e1Thanks @voxpelli! - Fix #197 with missing types -
#204
32e9b55Thanks @privatenumber! - fix type-import and value-import merging when import-as is used
4.5.0
Minor Changes
-
#192
fbf639bThanks @SukkaW! - The PR implements the new resolver design proposed in https://github.com/un-ts/eslint-plugin-import-x/issues/40#issuecomment-2381444266For
eslint-plugin-import-xusersLike the ESLint flat config allows you to use js objects (e.g. import and require) as ESLint plugins, the new
eslint-plugin-import-xresolver settings allow you to use js objects as custom resolvers through the new settingimport-x/resolver-next:// eslint.config.js import { createTsResolver } from '#custom-resolver'; const { createOxcResolver } = require('path/to/a/custom/resolver'); const resolverInstance = new ResolverFactory({}); const customResolverObject = { interfaceVersion: 3, name: 'my-custom-eslint-import-resolver', resolve(modPath, sourcePath) { const path = resolverInstance.resolve(modPath, sourcePath); if (path) { return { found: true, path }; } return { found: false, path: null } }; }; module.exports = { settings: { // multiple resolvers 'import-x/resolver-next': [ customResolverObject, createTsResolver(enhancedResolverOptions), createOxcResolver(oxcOptions), ], // single resolver: 'import-x/resolver-next': [createOxcResolver(oxcOptions)] } }The new
import-x/resolver-nextno longer accepts strings as the resolver, thus will not be compatible with the ESLint legacy config (a.k.a..eslintrc). Those who are still using the ESLint legacy config should stick withimport-x/resolver.In the next major version of
eslint-plugin-import-x(v5), we will rename the currently existingimport-x/resolvertoimport-x/resolver-legacy(which allows the existing ESLint legacy config users to use their existing resolver settings), andimport-x/resolver-nextwill become the newimport-x/resolver. When ESLint v9 (the last ESLint version with ESLint legacy config support) reaches EOL in the future, we will removeimport-x/resolver-legacy.We have also made a few breaking changes to the new resolver API design, so you can't use existing custom resolvers directly with
import-x/resolver-next:// When migrating to `import-x/resolver-next`, you CAN'T use legacy versions of resolvers directly: module.exports = { settings: { // THIS WON'T WORK, the resolver interface required for `import-x/resolver-next` is different. 'import-x/resolver-next': [ require('eslint-import-resolver-node'), require('eslint-import-resolver-webpack'), require('some-custom-resolver') ]; } }For easier migration, the PR also introduces a compat utility
importXResolverCompatthat you can use in youreslint.config.js:// eslint.config.js import eslintPluginImportX, { importXResolverCompat } from 'eslint-plugin-import-x'; // or const eslintPluginImportX = require('eslint-plugin-import-x'); const { importXResolverCompat } = eslintPluginImportX; module.exports = { settings: { // THIS WILL WORK as you have wrapped the previous version of resolvers with the `importXResolverCompat` 'import-x/resolver-next': [ importXResolverCompat(require('eslint-import-resolver-node'), nodeResolveOptions), importXResolverCompat(require('eslint-import-resolver-webpack'), webpackResolveOptions), importXResolverCompat(require('some-custom-resolver'), { option1: true, option2: '' }) ]; } }For custom import resolver developers
This is the new API design of the resolver interface:
export interface NewResolver { interfaceVersion: 3 name?: string // This will be included in the debug log resolve: (modulePath: string, sourceFile: string) => ResolvedResult } // The `ResultNotFound` (returned when not resolved) is the same, no changes export interface ResultNotFound { found: false path?: undefined } // The `ResultFound` (returned resolve result) is also the same, no changes export interface ResultFound { found: true path: string | null } export type ResolvedResult = ResultNotFound | ResultFoundYou will be able to import
NewResolverfromeslint-plugin-import-x.The most notable change is that
eslint-plugin-import-xno longer passes the third argument (options) to theresolvefunction.We encourage custom resolvers' authors to consume the options outside the actual
resolvefunction implementation. You can export a factory function to accept the options, this factory function will then be called inside theeslint.config.jsto get the actual resolver:// custom-resolver.js exports.createCustomResolver = (options) => { // The options are consumed outside the `resolve` function. const resolverInstance = new ResolverFactory(options); return { name: 'custom-resolver', interfaceVersion: 3, resolve(mod, source) { const found = resolverInstance.resolve(mod, {}); // Of course, you still have access to the `options` variable here inside // the `resolve` function. That's the power of JavaScript Closures~ } } }; // eslint.config.js const { createCustomResolver } = require('custom-resolver') module.exports = { settings: { 'import-x/resolver-next': [ createCustomResolver(options) ]; } }This allows you to create a reusable resolver instance to improve the performance. With the existing version of the resolver interface, because the options are passed to the
resolverfunction, you will have to create a resolver instance every time theresolvefunction is called:module.exports = { interfaceVersion: 2, resolve(mod, source) { // every time the `resolve` function is called, a new instance is created // This is very slow const resolverInstance = ResolverFactory.createResolver({}) const found = resolverInstance.resolve(mod, {}) }, }With the factory function pattern, you can create a resolver instance beforehand:
exports.createCustomResolver = options => { // `enhance-resolve` allows you to create a reusable instance: const resolverInstance = ResolverFactory.createResolver({}) const resolverInstance = enhanceResolve.create({}) // `oxc-resolver` also allows you to create a reusable instance: const resolverInstance = new ResolverFactory({}) return { name: 'custom-resolver', interfaceVersion: 3, resolve(mod, source) { // the same re-usable instance is shared across `resolve` invocations. // more performant const found = resolverInstance.resolve(mod, {}) }, } }
Patch Changes
-
#184
bc4de89Thanks @marcalexiei! - fix(no-cycle): improves the type declaration of the ruleno-cycle’smaxDepthoption -
#184
bc4de89Thanks @marcalexiei! - fix(first): improves the type declaration of the rulefirst's option -
#184
bc4de89Thanks @marcalexiei! - fix(no-unused-modules): improves the type declaration of the ruleno-unused-modules’smissingExportsoption -
#184
bc4de89Thanks @marcalexiei! - fix(no-deprecated): improve error message when no description is available
4.4.3
Patch Changes
4.4.2
Patch Changes
- #181
cc4ee65Thanks @SukkaW! - Fix #144, read propersourceTypefor both eslint flat config and legacy eslintrc config.
4.4.1
Patch Changes
-
#175
acebd98Thanks @marcalexiei! - fix(extensions): correctOptionstype -
#174
e01dce0Thanks @marcalexiei! - fix(no-extraneous-dependencies): correct someOptionstype properties
4.4.0
Minor Changes
- #169
9c58269Thanks @teidesu! - Add new rule optioncheckTypedImportsforextensions, backports https://github.com/import-js/eslint-plugin-import/pull/2817
Patch Changes
-
#171
9715220Thanks @SukkaW! - Perf: avoid regexp during parser choosing -
#171
9715220Thanks @SukkaW! - Add extra guard for ruleno-named-as-default. A few guards are borrowed from https://github.com/import-js/eslint-plugin-import/pull/3032, but we don't sync the rest of changes from upstream since we have already implemented a way more performant check. -
#171
9715220Thanks @SukkaW! - More test cases forno-named-exportandno-defualt-exportrule specifically with non-modulesourceType -
#171
9715220Thanks @SukkaW! - Fixexportwhen there is only oneTSDeclareFunction(https://github.com/import-js/eslint-plugin-import/pull/3065) -
#171
9715220Thanks @SukkaW! - PreventExportMap's cache is being tainted by incompatible parser (e.g. oldbabel-eslint). The cache is now skipped w/ incompatible parsers, which might introduce performance impacts only for those who are using incompatible parsers. (https://github.com/import-js/eslint-plugin-import/pull/3062) -
#171
9715220Thanks @SukkaW! - Docs: fix a few typos here and there -
#168
5de039cThanks @hyoban! - Fixes https://github.com/un-ts/eslint-plugin-import-x/issues/167, theno-duplicatesrule now allows co-existing inline type imports and namespace imports. -
#171
9715220Thanks @SukkaW! - Properly fix espree parser w/ ESLint Flat Config
4.3.1
Patch Changes
- #162
38d0081Thanks @AaronMoat! - Fix issue whereno-duplicatesrule withprefer-inlineincorrectly marks default type and named type imports as duplicates
4.3.0
Minor Changes
- #159
4da5388Thanks @GoodbyeNJN! - feat: add support for using resolver object directly in settings
4.2.1
Patch Changes
-
#148
d228129Thanks @SukkaW! - Fixnewline-after-import'sconsiderCommentsoptions when lintingrequire, backports https://github.com/import-js/eslint-plugin-import/pull/2952 -
#147
eca73edThanks @nchevsky! - Fix regression in ruleno-unused-moduleswhich would incorrectly initialize optionsrcto[]instead of[process.cwd()], breaking file discovery. -
#148
d228129Thanks @SukkaW! - Fixno-duplicatesfor TypeScript, backports https://github.com/import-js/eslint-plugin-import/pull/3033
4.2.0
Minor Changes
Patch Changes
- #146
e5e4580Thanks @SukkaW! - Fix https://github.com/nuxt/eslint/issues/494 by avoid importing from@typescript-eslint/typescript-estree.
4.1.1
Patch Changes
- #133
757ffa9Thanks @SukkaW! - Fix #123 where the ruleno-named-as-defaultwill confuse TypeScript namespace exports with actual exports.
4.1.0
Minor Changes
-
#122
cd52e86Thanks @michaelfaith! - Add ESLint flat configuration presets. You can access them with:import eslintPluginImportX from 'eslint-plugin-import-x' eslintPluginImportX.flatConfigs.recommended eslintPluginImportX.flatConfigs.react eslintPluginImportX.flatConfigs.typescript eslintPluginImportX.flatConfigs.electron -
#132
9948c78Thanks @SukkaW! - Addedno-rename-defaultthat forbid importing a default export by a different name. Originally created by @whitneyit, ported by @SukkaW
4.0.0
Major Changes
- #112
4ba14daThanks @SukkaW! - Use typescript-eslint v8. The minimum supported ESLint version is now >= 8.57.0 and the minimum required Node.js version is now 18.18.0.
3.1.0
Minor Changes
- #116
38aa4cbThanks @silverwind! - AddignoreUnusedTypeExportsoption tono-unused-modules
Patch Changes
-
#118
0307ff2Thanks @SukkaW! - Reverts #111. The introduction of SCC causes extra overhead that overcomes the early return it introduced.A new
no-cycle-nextrule is being implemented using the graph. It won't be backward compatible with the current ruleno-cycle. The currentno-cyclerule will becomeno-cycle-legacyin the next major version.
3.0.1
Patch Changes
-
#109
fe3121aThanks @SukkaW! - Makeeslint-plugin-import-xoverall faster by refactoring theExportMaputil -
#111
5cce946Thanks @SukkaW! - Drastically improveno-cycle's performance by skipping unnecessary BFSes using Tarjan's SCC.
3.0.0
Major Changes
-
#106
19f10aaThanks @SukkaW! -eslint-plugin-import-xis a fork ofeslint-plugin-importthat aims to provide a more performant and more lightweight version of the original plugin.Due to the nature of the fork, all
eslint-plugin-import's git tags and releases have been copied over toeslint-plugin-import-x. This causes version conflicts when publishing new versions ofeslint-plugin-import-x.To prevent this, we have decided to publish a new major version of
eslint-plugin-import-xthat will not conflict with the originaleslint-plugin-import's versions.See also https://github.com/un-ts/eslint-plugin-import-x/issues/76
Patch Changes
0.5.3
Patch Changes
-
#101
c0cea7bThanks @SukkaW! - Allow incorrect file path in extraneous deps check -
#100
293fcf4Thanks @SukkaW! - feat: webpack comment regex supportwebpackFetchPriority -
#85
ded3e80Thanks @kosmotema! - add languageOptions to ChildContext -
#100
293fcf4Thanks @SukkaW! - Allow empty chunk name when webpackMode: 'eager' is set; add suggestions to remove name in eager mode
0.5.2
Patch Changes
0.5.1
Patch Changes
0.5.0
Minor Changes
-
#66
49418a0Thanks @JounQin! - chore(dep)!: drop eslint <8.56 support -
#66
49418a0Thanks @JounQin! - feat!: upgrade @typescript-eslint/utils to v7
0.4.4
Patch Changes
0.4.3
Patch Changes
0.4.2
Patch Changes
- #62
1dbb323Thanks @JounQin! - feat: use eslint-compat-utils to support eslint v9 (not flat config yet)
0.4.1
Patch Changes
0.4.0
Minor Changes
0.3.1
Patch Changes
-
#51
f4ca4b5Thanks @JounQin! - refactor: migrate all remaining rules -
#50
de896f4Thanks @JounQin! - refactor: migrate several rules
0.3.0
Minor Changes
Patch Changes
0.2.0
Minor Changes
-
#38
3a5dab4Thanks @JounQin! - chore!: bump all upgradable (dev)Dependencies -
#36
49e3cd2Thanks @JounQin! - feat!: replace tsconfig-paths with get-tsconfig