npm / eslint-plugin-import-x
eslint-plugin-import-x
What changed in eslint-plugin-import-x 4, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-30.
9 breaking1 deprecations7 new APIs and options6 performance9 behavior and defaults1 tooling44 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initeslint-plugin-import-x 477 changes
Breaking changes 9
Qualified TypeScript namespace declarations behind export = now expose only the immediate namespace member, rather than deeper names or block members as direct exports.
The lexer route resolves export { x } from a non-namespace import as a re-export rather than an own export.
Keeps trailing comments and line-scoped directives with their targets when moving imports, and withholds autofixes for groups containing a moved import with comments.
Counts export * as ns from '…' as a runtime dependency while keeping export type * as ns from type-only.
Reports namespace member access to names exported only as types because those names are erased at runtime; classes, enums, and names that are both types and values remain accepted.
Checks all enclosing scopes for name conflicts before autofixing namespace member access, and reports default or string-keyed members without a fix.
The alphabetize comparator is transitive, so parent imports consistently sort before sibling imports in the same group and results no longer depend on the Node version.
The minimum supported ESLint version is now 8.57.0.
The minimum required Node.js version is now 18.18.0.
Deprecations 1
The rule is a no-op on ESLint 10 or later for now, and emits a warning about this behavior.
New APIs and options 7
Adds a rule ported from eslint-plugin-barrel-files for detecting barrel files.
Adds a rule that checks runtime references to barrel files, including imports, re-exports, dynamic imports, and require calls; type-only statements are exempt.
Adds a rule ported from eslint-plugin-barrel-files for detecting namespace imports.
Adds an option that treats a package's import of its own subpath export as a package import, so ignorePackages applies.
Adds a whitelist for entry points that share one declaration file but are different modules.
Adds a top mode that requires no-specifier ESM imports to appear before assigned imports.
Suppresses the warning about
no-unused-modulesbeing a no-op on ESLint 10 or later.
Performance 6
Skips exact export-surface parsing for lexer-analyzed dependencies whose export count is at or below the barrel threshold; unrecognized syntax and default-export modules still use the parser.
Memoizes export-kind lookups per module and name, with independent cached answers for type-only and value exports.
Caches legacy resolver lookups per directory instead of resolving the resolver package on every import resolution.
Rewrites module analysis to use es-module-lexer for plain JavaScript, analyze lazily, and share cached results between rules. TypeScript, JSX, and Flow still use the ESLint parser.
Cache keys use a short id per distinct settings hash instead of copying the full settings, parserOptions, and parser hash into every key, avoiding memory exhaustion with large settings.
Reduces CPU usage for converging dependency graphs.
Behavior and default changes 9
When an extensionless import cannot be resolved as-is, tries extensions configured as always and uses a unique resolving extension for fixes or suggestions; ambiguous cases are reported without guessing.
Drops only dynamic declarations for a path, preserving checks for static cycles and other imports in the same module.
Reports cycles through side-effect imports and analyzes files whose only module syntax is a side-effect import.
Without prefer-inline, the autofix moves inline type specifiers into the module's import type declaration and leaves value specifiers in a separate import.
When no package.json exists above the linted file, uses ESLint's working directory as the package root; without packageDir, the rule lints nothing.
Reports the runtime package rather than its @types/* package for imports resolving to type definitions; whitelist accepts either name, while includeTypes type-only imports still require only @types/*.
Allows packages to import themselves when package.json defines exports; importing the package's own name without exports is reported with the selfImport message.
The setting now supports RegExp values for ignoring imports.
The rule's
ignoreoption now supports RegExp values.
Tooling 1
The peer dependency version range now includes ESLint 10 support.
Fixes and other changes 44
Extensionless imports resolving to files whose extensions are set to never no longer require a js alias.
The autofix places imports above decorators and on their own line when there is no semicolon, avoiding output that fails to parse.
The plugin no longer loads the optional peer at runtime, so it loads without that package.
The prefer-top-level autofix preserves quotes around string specifier names when moving them into a new import type declaration.
Honors pathGroupOverrides when pattern, ignorePackages, or checkTypeImports is not provided.
Directory-import fixes and suggestions resolve to the index file, and rewrites are offered only when the resolved import points back to the same file.
Recognizes resolver extension aliases instead of reporting them as missing extensions; inference only accepts candidates resolving to the same file, and ambiguous results receive no fix.
Imported plain JavaScript files with syntax errors no longer produce a “Parse errors in imported module” report; ESLint still reports the syntax error when linting the file itself.
Falls back to AST analysis for .js files with export declaration heads the lexer route does not handle faithfully, preventing exported names from being dropped.
Treats import x = require('y') and export import x = require('y') as module references so rules built on moduleVisitor see their specifiers; type-only forms remain ignored by no-cycle and avoid-importing-barrel-files.
Avoids reporting members of a parameter that shadows a namespace import when that namespace is also used in the same scope.
Reports namespace member access in decorator expressions by walking up to the enclosing module scope.
Does not report a heritage clause naming a type from a module resolved to JavaScript, which has no types to check against.
Places the blank line around trailing comments so directives such as prettier-ignore keep their target.
Ignores comments between two imports when considerComments is enabled.
Treats a comment on the import's own line as part of the import, avoids placing autofix lines between the import and its trailing comment, and withholds fixes that would detach line-scoped directives.
Prefixes ./ when a fixed path starts with a dot directory such as .config/, preventing it from becoming a package import.
The autofix no longer treats commas inside comments as specifier separators.
Treats imports of one path with different attributes as distinct and preserves attributes, type-only imports, and resolution-mode syntax in autofixes.
The autofix removes extra whitespace before the closing brace when merging import specifiers.
Preserves aliased specifiers when merging imports and avoids corrupting from or alias syntax with prefer-inline when the first import is import type.
Reports a module imported twice with import type * as.
Uses tokens from the reported import in the side-effect suggestion so an earlier import cannot cause the suggestion to leave code unchanged.
No longer asks developers to add a package already in devDependencies or optionalDependencies when its import resolves through @types/*.
Ignores inline type-only export specifiers when verifyTypeImports is off, matching the treatment of inline type imports.
Dependency checks merge dependencies from the closest package.json as well as packageDir, so workspace packages use their own manifest; bundledDependencies from merged manifests are unioned.
Supports minimatch v9, v10, and v11 by matching allow and forbid globs with Minimatch#match instead of makeRe.
Ignores type-only named exports.
TypeScript namespace members are ignored by no-named-as-default and no-named-as-default-member.
Does not autofix computed namespace member access, which could otherwise rewrite lookups incorrectly or produce invalid imports; the rule still reports these cases.
Avoids crashes and broken autofixes for namespace members named like Object.prototype properties.
Builds suggested package paths from the resolved file below the package root and offers an autofix only when the path resolves to the original module.
missingExports no longer reports files with only export * declarations as having no exports; unusedExports recognizes export * as ns as export ns and counts the source as namespace imported.
Export names that resemble internal bookkeeping keys no longer collide with the rule, and import { default as x } counts as use of the default export.
The autofix moves all out-of-order imports in a block at once, so one --fix handles blocks with more than 10 misplaced imports.
The autofix compares statement indexes numerically, preventing imports from moving across non-import statements when indexes sort differently as strings.
The autofix preserves a namespace specifier when splitting a default import, preventing invalid output for imports such as import Foo, * as Bar from 'foo'.
Package subpaths that resolve to a .d.ts file no longer require an extension.
The rule now checks Node.js subpath imports beginning with
#for extensions.The rule now handles
.d.tsfiles correctly.Querystrings and hash fragments are stripped when checking whether a file exists.
Case-sensitive path checks no longer crash when an ancestor directory returns EACCES or EPERM.
The rule now allows an exception for TypeScript resolution-mode import attributes.
The plugin is compatible with ESLint's
defineConfig.