unstale

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 init

@unstale/cli on npm

eslint-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.

    4.18.0release notes

  • The lexer route resolves export { x } from a non-namespace import as a re-export rather than an own export.

    4.18.0release notes

  • Keeps trailing comments and line-scoped directives with their targets when moving imports, and withholds autofixes for groups containing a moved import with comments.

    4.18.0release notes

  • Counts export * as ns from '…' as a runtime dependency while keeping export type * as ns from type-only.

    4.18.0release notes

  • 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.

    4.18.0release notes

  • Checks all enclosing scopes for name conflicts before autofixing namespace member access, and reports default or string-keyed members without a fix.

    4.18.0release notes

  • 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.

    4.18.0release notes

  • The minimum supported ESLint version is now 8.57.0.

    4.0.0release notes

  • The minimum required Node.js version is now 18.18.0.

    4.0.0release notes

Deprecations 1

  • The rule is a no-op on ESLint 10 or later for now, and emits a warning about this behavior.

    4.16.2release notes

New APIs and options 7

  • Adds a rule ported from eslint-plugin-barrel-files for detecting barrel files.

    4.18.0release notes

  • Adds a rule that checks runtime references to barrel files, including imports, re-exports, dynamic imports, and require calls; type-only statements are exempt.

    4.18.0release notes

  • Adds a rule ported from eslint-plugin-barrel-files for detecting namespace imports.

    4.18.0release notes

  • Adds an option that treats a package's import of its own subpath export as a package import, so ignorePackages applies.

    4.18.0release notes

  • Adds a whitelist for entry points that share one declaration file but are different modules.

    4.18.0release notes

  • Adds a top mode that requires no-specifier ESM imports to appear before assigned imports.

    4.18.0release notes

  • Suppresses the warning about no-unused-modules being a no-op on ESLint 10 or later.

    4.16.2release notes

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.

    4.18.0release notes

  • Memoizes export-kind lookups per module and name, with independent cached answers for type-only and value exports.

    4.18.0release notes

  • Caches legacy resolver lookups per directory instead of resolving the resolver package on every import resolution.

    4.18.0release notes

  • 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.

    4.18.0release notes

  • 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.

    4.18.0release notes

  • Reduces CPU usage for converging dependency graphs.

    4.18.0release notes

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.

    4.18.0release notes

  • Drops only dynamic declarations for a path, preserving checks for static cycles and other imports in the same module.

    4.18.0release notes

  • Reports cycles through side-effect imports and analyzes files whose only module syntax is a side-effect import.

    4.18.0release notes

  • Without prefer-inline, the autofix moves inline type specifiers into the module's import type declaration and leaves value specifiers in a separate import.

    4.18.0release notes

  • When no package.json exists above the linted file, uses ESLint's working directory as the package root; without packageDir, the rule lints nothing.

    4.18.0release notes

  • 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/*.

    4.18.0release notes

  • Allows packages to import themselves when package.json defines exports; importing the package's own name without exports is reported with the selfImport message.

    4.18.0release notes

  • The setting now supports RegExp values for ignoring imports.

    4.17.0release notes

  • The rule's ignore option now supports RegExp values.

    4.17.0release notes

Tooling 1

  • The peer dependency version range now includes ESLint 10 support.

    4.16.2release notes

Fixes and other changes 44

  • Extensionless imports resolving to files whose extensions are set to never no longer require a js alias.

    4.18.1release notes

  • The autofix places imports above decorators and on their own line when there is no semicolon, avoiding output that fails to parse.

    4.18.1release notes

  • The plugin no longer loads the optional peer at runtime, so it loads without that package.

    4.18.1release notes

  • The prefer-top-level autofix preserves quotes around string specifier names when moving them into a new import type declaration.

    4.18.0release notes

  • Honors pathGroupOverrides when pattern, ignorePackages, or checkTypeImports is not provided.

    4.18.0release notes

  • 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.

    4.18.0release notes

  • 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.

    4.18.0release notes

  • 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.

    4.18.0release notes

  • 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.

    4.18.0release notes

  • 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.

    4.18.0release notes

  • Avoids reporting members of a parameter that shadows a namespace import when that namespace is also used in the same scope.

    4.18.0release notes

  • Reports namespace member access in decorator expressions by walking up to the enclosing module scope.

    4.18.0release notes

  • Does not report a heritage clause naming a type from a module resolved to JavaScript, which has no types to check against.

    4.18.0release notes

  • Places the blank line around trailing comments so directives such as prettier-ignore keep their target.

    4.18.0release notes

  • Ignores comments between two imports when considerComments is enabled.

    4.18.0release notes

  • 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.

    4.18.0release notes

  • Prefixes ./ when a fixed path starts with a dot directory such as .config/, preventing it from becoming a package import.

    4.18.0release notes

  • The autofix no longer treats commas inside comments as specifier separators.

    4.18.0release notes

  • Treats imports of one path with different attributes as distinct and preserves attributes, type-only imports, and resolution-mode syntax in autofixes.

    4.18.0release notes

  • The autofix removes extra whitespace before the closing brace when merging import specifiers.

    4.18.0release notes

  • Preserves aliased specifiers when merging imports and avoids corrupting from or alias syntax with prefer-inline when the first import is import type.

    4.18.0release notes

  • Reports a module imported twice with import type * as.

    4.18.0release notes

  • Uses tokens from the reported import in the side-effect suggestion so an earlier import cannot cause the suggestion to leave code unchanged.

    4.18.0release notes

  • No longer asks developers to add a package already in devDependencies or optionalDependencies when its import resolves through @types/*.

    4.18.0release notes

  • Ignores inline type-only export specifiers when verifyTypeImports is off, matching the treatment of inline type imports.

    4.18.0release notes

  • 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.

    4.18.0release notes

  • Supports minimatch v9, v10, and v11 by matching allow and forbid globs with Minimatch#match instead of makeRe.

    4.18.0release notes

  • Ignores type-only named exports.

    4.18.0release notes

  • TypeScript namespace members are ignored by no-named-as-default and no-named-as-default-member.

    4.18.0release notes

  • Does not autofix computed namespace member access, which could otherwise rewrite lookups incorrectly or produce invalid imports; the rule still reports these cases.

    4.18.0release notes

  • Avoids crashes and broken autofixes for namespace members named like Object.prototype properties.

    4.18.0release notes

  • 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.

    4.18.0release notes

  • 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.

    4.18.0release notes

  • 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.

    4.18.0release notes

  • The autofix moves all out-of-order imports in a block at once, so one --fix handles blocks with more than 10 misplaced imports.

    4.18.0release notes

  • The autofix compares statement indexes numerically, preventing imports from moving across non-import statements when indexes sort differently as strings.

    4.18.0release notes

  • The autofix preserves a namespace specifier when splitting a default import, preventing invalid output for imports such as import Foo, * as Bar from 'foo'.

    4.18.0release notes

  • Package subpaths that resolve to a .d.ts file no longer require an extension.

    4.17.1release notes

  • The rule now checks Node.js subpath imports beginning with # for extensions.

    4.17.0release notes

  • The rule now handles .d.ts files correctly.

    4.17.0release notes

  • Querystrings and hash fragments are stripped when checking whether a file exists.

    4.17.0release notes

  • Case-sensitive path checks no longer crash when an ancestor directory returns EACCES or EPERM.

    4.17.0release notes

  • The rule now allows an exception for TypeScript resolution-mode import attributes.

    4.16.2release notes

  • The plugin is compatible with ESLint's defineConfig.

    4.16.2release notes