NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
npm, #4506 most downloaded on npm
Import with sanity.
Latest stable
4.18.1
Last release 13 days ago
09 Nov 2026
Ships unpredictably
gaps range from 8 days to 9 months
Nearly every release is documented
notes for 60 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
3 years old
71 releases · first in 2024
Drag across the ruler to compare, or tap a release to open it.
@gilbarbara made their first contribution in https://github.com/un-ts/eslint-plugin-import-x/pull/604
#599 d9c8a4e Thanks @SwastikTripathi! - fix(core): don't load the optional @typescript-eslint/utils peer at runtime, so the plugin loads again without it
#604 28779e0 Thanks @gilbarbara! - fix(extensions): stop requiring a js alias on extensionless imports that resolve to a file whose extension is never, such as .ts with { js: 'always', ts: 'never' }.
#600 6172d1d Thanks @thekhegay! - fix(first): the autofix puts imports above the decorators of @dec() export class and on their own line when they have no semicolon, it could leave code that doesn't parse in both cases
Full Changelog: https://github.com/un-ts/eslint-plugin-import-x/compare/v4.18.0...v4.18.1
Your coding agent can read these notes before it upgrades. Set up the MCP server →
There are no breaking changes: no configuration changes are needed, and no behavior changes are intended. Every rule should report exactly what it rep…
#520 802441c Thanks @SwastikTripathi! - Add a checkSelfReference option to the extensions rule. When set, a package's import of its own subpath export (e.g. pkg/sub from inside pkg) is treated as a package import, so ignorePackages applies to it.
#403 f4d0a4b Thanks @Zamiell! - extensions: when an import has no extension and cannot be resolved as-is, try the extensions configured as always in pattern and use the unique one that resolves for the fix or suggestion. If several resolve, report the missing extension without guessing. When no extension can be determined automatically, explain that in the missing message instead of only reporting a bare missing extension.
#572 fc17206 Thanks @SwastikTripathi! - feat(no-duplicates): add a whitelist option listing entry points that share one declaration file but are different modules, such as svelte and svelte/easing
#504 f10dcc4 Thanks @morgan-coded! - Add a "top" mode to the order rule's warnOnUnassignedImports option for requiring no-specifier ESM imports before assigned imports.
#502 9c85ced Thanks @SukkaW! - Rewrite the module analysis core for performance boosts. The speedup depends on your project, and we expect no performance regression in any setup — if you measure one, please report it.
Rules like named, default, namespace, no-cycle, no-deprecated, and many more, need to know what the modules you import actually export. Until now, answering that meant running the full ESLint parser over every one of those files — including everything you pull in from node_modules.
That core has been rewritten:
es-module-lexer instead of being parsed. Anything it can't read faithfully — TypeScript, JSX, Flow — still goes through the ESLint parser exactly as before.There are no breaking changes: no configuration changes are needed, and no behavior changes are intended. Every rule should report exactly what it reported before, with one known exception: an imported plain JavaScript file that has a syntax error no longer gets a "Parse errors in imported module" report. ESLint still reports the syntax error when it lints that file itself. The full test suite passes, but there could be some edge cases. If a rule starts reporting something it didn't before, or stops reporting something it should, please open an issue with a minimum reproduction — bug reports on this are very welcome.
#456 7b78aae Thanks @43081j! - Add four barrel file detection rules ported from eslint-plugin-barrel-files: avoid-barrel-files, avoid-importing-barrel-files, avoid-namespace-import and avoid-re-export-all.
avoid-importing-barrel-files checks every runtime way a module can be referenced — static imports, re-exports (export … from, export * from, export * as ns from), dynamic import() and CommonJS require() — with type-only statements exempt.
#157 89cfe42 Thanks @Zamiell! - feat(no-rename-default): accept names derived from bare package paths and add a whitelist option for modules that mangle their default export names
#562 7cbe683 Thanks @JounQin! - perf(avoid-importing-barrel-files): skip the surface parse for a dependency that cannot be a barrel
The rule sizes the runtime module graph behind every imported target, and a
target only becomes a candidate once its export count passes
amountOfExportsToConsiderModuleAsBarrel. A lexer-analyzed module already
reports its export entries, so a count at or below the threshold settles the
question without producing the exact export/declaration surface — one parse
saved per small plain-JS dependency.
Anything es-module-lexer does not read faithfully still goes through the parser,
and a module whose source declares a default export is never ruled out: the
properties of export default { … } are exports no entry count can see (a
default that esModuleInterop synthesizes does not count).
A declarator that binds no name — export const {} = obj, export const { a: {} } = obj — is no longer counted as an export by the barrel surface: it
exports nothing, and counting it made the surface disagree with the lexer's
entry count.
#568 225a5aa Thanks @SwastikTripathi! - Fix no-extraneous-dependencies telling you to add a package that is already in devDependencies or optionalDependencies when its import resolves through @types/*
#579 db16385 Thanks @thekhegay! - fix(core): keep the size of settings out of module and resolver cache keys
Every key held the full stableHash text of settings, parserOptions and the parser. One large value in shared settings, like a custom alphabet from eslint-plugin-perfectionist, was copied into each key on every resolve, so no-cycle and any other rule that resolves imports could run out of memory. Keys now hold a short id per distinct hash.
#309 4b9ea02 Thanks @remcohaszing! - Allow packages to import themselves in import-x/no-extraneous-dependencies when the exports field is defined in package.json; importing a package's own name without exports is reported by the new selfImport message.
#565 3d0f5a9 Thanks @SwastikTripathi! - fix(namespace, no-deprecated): don't report members of a parameter that shadows a namespace import when the namespace is also used in the same scope, e.g. in a type annotation
#539 bb7b18b Thanks @SwastikTripathi! - chore(deps): upgrade es-module-lexer from v2 to v3. The v3 API is a complete redesign using discriminated union types (StaticImport | DynamicImport | ImportMetaRef for imports, DirectExport | Reexport | ReexportAll for exports) replacing numeric d fields and short property names. The lexer route now resolves export { x } where x comes from a non-namespace import as a reexport rather than an own export, which is more semantically accurate.
#566 4c66c87 Thanks @SwastikTripathi! - fix(export): don't report a namespace that only declares types as a duplicate of a value with the same name
#536 db674b5 Thanks @SukkaW! - fix(export): check types and values separately
export type * from only re-exports types, so it no longer conflicts with a value export of the same name, and a type reached through export * no longer conflicts with a value. Duplicate types among re-exports are now reported, as are a type-only export and a value export of the same name, and ambient function overloads that clash with another export. String-literal export names such as "type:Foo" are no longer mistaken for type exports. Fixes #414.
#594 0c82c7e Thanks @i1stG! - fix(extensions): resolve directory imports to their index file in autofixes and suggestions, and only offer rewrites of resolved imports that point back to the same file.
#571 2bc321d Thanks @TonyTech404! - Fix the extensions rule treating an extension alias as a missing extension. An import such as ./foo.js that the resolver maps to foo.ts now keeps its own extension instead of being reported as missing ts and autofixed to ./foo.js.ts. The pattern extension inference also recognizes an extension alias, so an extensionless ./foo that resolves that way is fixed to ./foo.js. The inference only accepts a candidate that resolves to the same file, and an ambiguous result is reported without a fix. Type-only imports and exports (including inline type specifiers) are ignored before the extension branches, so an aliased .js specifier is preserved when checkTypeImports is off.
#512 42dba04 Thanks @LeulTew! - fix(extensions): honor pathGroupOverrides when no pattern, ignorePackages, or checkTypeImports option is provided.
#575 27112d6 Thanks @SwastikTripathi! - fix: keep trailing comments and line-scoped directives with their targets. first inserts moved imports right after the directive/statement, before any trailing comment, and withholds the autofix for the whole group when a moved import has comments. newline-after-import inserts the blank before a single-line trailing comment (or after a multi-line one), so third-party directives such as prettier-ignore keep their target. Both rules share the getTrailingComments util.
#555 27876f2 Thanks @JounQin! - perf(core): memoize getExportKind per module and name
Rules ask for an export kind once per imported specifier and once per
namespace member access. Without a memo, every lookup re-walks all export *
paths and re-resolves each target; on a 100-star barrel, 2,000 namespace
member accesses took ~5.7 s instead of ~0.1 s. Answers are cached per
(module, name, typeOnly), so the type-only and value answers stay
independent.
#519 f6a66a0 Thanks @Cherry! - perf: cache legacy resolver lookups per directory instead of re-resolving the resolver package on every import resolution.
#570 7254048 Thanks @devon-scythe! - fix: support minimatch v9/v10/v11 and drop makeRe
minimatch v11 is the only release line with the fix for GHSA-g3hv-75wg-m249.
It removes makeRe(), so no-internal-modules now matches its allow and
forbid globs with Minimatch#match.
#535 66632ec Thanks @SwastikTripathi! - fix(core): send a .js file to the AST route when es-module-lexer cannot read one of its exports. On the lexer fast path, an export the lexer does not read was dropped from the module's export set as soon as the file had any export it did read, so hasExport/getExportNames — and named, namespace, default, no-named-as-default with them — reported the name as missing. The lexer route now keeps only the declaration heads whose exported names are read faithfully by es-module-lexer v3 (default, {, *, function, class, const, let, var) and bails on every unrecognised head as a conservative fallback, including module, using, await using, @dec class, abstract class, declare, enum, const enum, namespace, and interface (v3 reads those, but they are not yet in the whitelist).
#534 595f2d7 Thanks @SwastikTripathi! - fix(module-visitor): treat import x = require('y') as a module reference, so every rule built on moduleVisitor (no-unresolved, no-cycle, extensions, no-extraneous-dependencies, no-restricted-paths, no-absolute-path, …) sees the specifier. export import x = require('y') was missed too, because its ExportNamedDeclaration has a null source. no-cycle and avoid-importing-barrel-files keep ignoring the type-only form, import type x = require('y')
#556 19ff6c5 Thanks @SwastikTripathi! - fix(namespace): report member access in decorator expressions by walking up to the enclosing module scope.
#567 b2afa70 Thanks @SwastikTripathi! - fix(namespace): don't report a heritage clause that names a type from a module resolved to JavaScript, which has no types to check against.
#526 8f4f6b9 Thanks @JounQin! - fix: count export * as ns from '…' as a runtime dependency in the module analysis core
export * as ns from 'x' loads x at runtime, but both ModuleInfo construction paths omitted the edge, so graph traversal — and avoid-importing-barrel-files in particular — could undercount the modules an import pulls in. The namespace export metadata is unchanged, and export type * as ns from stays type-only. Fixes #525.
#541 bbd0026 Thanks @MFA-G! - fix(namespace): report members exported only as types
A name exported only as a type (export type Foo, export interface Foo, export type { Foo }, export type * from) is erased at runtime, so accessing it as a member of an imported namespace (ns.Foo, const { Foo } = ns, <ns.Foo />) is now reported. Classes, enums and names that are both a type and a value are still accepted, and unresolvable names still fail open. Fixes #540.
#543 35fc9bf Thanks @thekhegay! - fix(newline-after-import): ignore comments between two imports when considerComments is enabled, matching eslint-plugin-import.
#577 5169813 Thanks @SwastikTripathi! - fix(newline-after-import): treat a comment on the import's own line as part of the import
With considerComments, a trailing comment such as import a from 'a' // why
was taken as the comment after the import, so the rule reported even with an
empty line before the next statement. The autofix also inserted the new lines
between the import and its trailing comment, moving the comment onto its own
line. Both now skip comments that start on the statement's last line.
The fix is withheld when any trailing comment is a line-scoped directive
(eslint-disable-next-line, @ts-ignore, @ts-expect-error), so the directive
keeps its target, and comments inside the following statement no longer satisfy
the blank-line check.
#591 65ea15c Thanks @SwastikTripathi! - fix(no-absolute-path): prefix ./ when the fixed path starts with a dot directory such as .config/, which would otherwise turn into a package import
#507 aa1071d Thanks @BridgeAR! - Reduce no-cycle CPU usage for converging dependency graphs.
#518 c45cfb9 Thanks @wimvanschandevijl! - fix(no-cycle): allowUnsafeDynamicCyclicDependency no longer hides static-only cycles that happen to sit in the same module as an unrelated dynamic import
Previously, no-cycle's traversal bailed out of a module's entire remaining import list as soon as it found one path where any declaration was dynamic - return rather than continue inside the loop over m.imports. That meant:
Both are now handled per-declaration: only the dynamic declarations for a path are dropped when allowUnsafeDynamicCyclicDependency is set, and only that one path is skipped when nothing traversable remains - the module's other, unrelated import paths (and any static declaration to the very same path) are still checked. See #515 for the repro that found this.
#538 b6a674b Thanks @b84330808! - fix(no-cycle): report cycles through side-effect imports such as import './foo' and import {} from './foo'. They have no specifiers, so they were skipped as if they were type-only imports. The unambiguous-module prefilter also recognizes them now, so a file whose only module syntax is a side-effect import is analyzed on the AST route too, as it already was on the lexer route
#585 8777312 Thanks @thekhegay! - fix(no-duplicates): do not treat commas inside comments as specifier separators in the autofix
#581 76e97db Thanks @thekhegay! - fix(no-duplicates): imports of one path with different attributes are not duplicates, and the autofix no longer drops an attribute, mistakes the braces of with {...} for the braces of the specifiers, or takes a resolution-mode import out of import type
#584 85c1b88 Thanks @thekhegay! - fix(no-duplicates): remove extra whitespace before the closing brace when merging import specifiers
#522 56b1c48 Thanks @giaBaoJS! - fix(no-duplicates): the autofix no longer drops x when merging import { x } into an import of x as y, and prefer-inline no longer turns the from keyword or an alias into type ... when the first import is import type { ... }
#546 1eb95b0 Thanks @thekhegay! - fix(no-duplicates): report a module imported twice with import type * as, as it already does for import * as and import type x
#548 d565b2f Thanks @thekhegay! - fix(no-duplicates): without prefer-inline, the autofix moves inline type specifiers into the import type { ... } of the same module and leaves the value specifiers in their own import, instead of merging both into one import that is invalid or changes which specifiers are type-only.
#574 2fd859d Thanks @SwastikTripathi! - fix(no-empty-named-blocks): use the reported import's tokens in the side-effect suggestion
The suggestion looked up import and from in the whole file, so an earlier import with a from clause, like import a from 'a', supplied the tokens and the suggestion left the code unchanged. Earlier side-effect imports have no from and weren't affected.
#547 3598430 Thanks @thekhegay! - fix(no-extraneous-dependencies): report the runtime package instead of its @types/* package when an import resolves to type definitions, matching eslint-plugin-import. A @types/* package in dependencies no longer counts as a declaration of its runtime package, and whitelist accepts either name. A type-only import checked with includeTypes still needs only the @types/* package.
#571 2bc321d Thanks @TonyTech404! - fix(no-extraneous-dependencies): ignore inline type-only export specifiers when verifyTypeImports is off, as inline type imports already are
#580 059ca92 Thanks @thekhegay! - fix: ignore type-only named exports for no-named-as-default and no-named-as-default-member
#573 a3553f3 Thanks @SwastikTripathi! - fix(no-namespace): don't autofix computed member access on the namespace
foo[key] was fixed as if it were foo.key, importing an export named key and dropping the lookup, list[foo] was rewritten the same way, and foo[1] produced import { 1 }, which doesn't parse. All of them keep the namespace import now, and the rule still reports them.
#561 981ada8 Thanks @wleeaf! - fix(no-namespace): check all enclosing scopes for name conflicts in the autofix
The autofix only looked at the innermost scope of each ns.name reference and its parent for names that would shadow the new import, so a variable declared further out (or an undeclared global used elsewhere in the module) changed what the rewritten reference pointed to. It also turned ns.default and ns['some-key'] into named imports that aren't valid syntax; those are now reported without a fix.
#582 47c5419 Thanks @thekhegay! - fix(no-namespace): don't crash or write broken code on members named like Object.prototype ones, e.g. _.toString
#583 2538093 Thanks @thekhegay! - fix: don't crash with The "path" argument must be of type string when there is no package.json above the linted file. The directory ESLint runs in stands in for the root of the package, and no-extraneous-dependencies without packageDir lints nothing, as its documentation says
#560 4afef66 Thanks @wleeaf! - fix(no-relative-packages): keep the imported path when suggesting the package import
The suggested package import was built from the directory of the resolved file plus the last segment of the import path. An extensionless import of a file named like its package directory (../bar/src/bar) became bar/src, which resolves to another module, and a directory import (../bar/src) became bar/src/src. The suffix is now taken from the resolved file below the package root: explicit import extensions are preserved, extensionless imports omit the resolved extension, directory index files collapse back to the directory, and .d.ts targets drop the .d marker. If the package name itself resolves to the original module, it is preferred (for example ../node_modules/nested-main becomes nested-main). The autofix is only offered when the suggested package path resolves back to the original module; otherwise the rule reports without suggesting that path. Packages reached through symlinks (pnpm, workspaces) therefore keep their package name and path.
#524 2384a48 Thanks @giaBaoJS! - fix(no-unused-modules): missingExports no longer reports "No exports found" for a file whose only exports are export * from declarations, and unusedExports now checks export * as ns from as the export ns and counts its source module as namespace imported
#533 6ffa22e Thanks @giaBaoJS! - fix(no-unused-modules): exports named ImportDefaultSpecifier, ImportNamespaceSpecifier or ExportAllDeclaration no longer collide with the rule's internal bookkeeping keys, and import { default as x } now counts as a use of the default export
#593 9144c94 Thanks @thekhegay! - fix(order): move all out of order imports of a block in one fix, so one --fix is enough for a block with more than 10 of them
#544 1a2bf7a Thanks @thekhegay! - fix(order): compare statement indexes as numbers, so the autofix no longer moves an import across a non-import statement when the indexes sort differently as strings, such as 2 and 10.
#517 d6808bd Thanks @Cherry! - fix(order): make the alphabetize comparator transitive, so parent imports now consistently sort before sibling imports in the same group (matching eslint-plugin-import) and results no longer depend on the Node version
#578 57729ae Thanks @SwastikTripathi! - fix(prefer-namespace-import): keep a namespace specifier when splitting the default import
The autofix looked for { and } to find the other specifiers, so
import Foo, * as Bar from 'foo' was rewritten into code that does not parse.
It now takes the text between the comma after the default specifier and from,
which also covers * as Bar.
#564 ba0b9f6 Thanks @SwastikTripathi! - fix(core): declare namespace foo.bar.baz {} behind export = foo now only adds bar to the module's exports. baz and the block's members were previously reported as direct exports, so named accepted import { baz } and import { deep }, and a qualified declare module foo.qux {} exposed its members too.
#482 53a88f3 Thanks @B4nan! - Merge dependencies from the closest package.json in addition to packageDir in no-extraneous-dependencies, so workspace packages see the dependencies declared in their own manifest; bundledDependencies from every merged manifest are unioned instead of overwritten.
#492 9669829 Thanks @andersk! - Ignore TypeScript namespace members for no-named-as-default, no-named-as-default-member rules
#590 8c11eb7 Thanks @SwastikTripathi! - fix(consistent-type-specifier-style): keep the quotes of a string specifier name, like type "a-b" as AB, when the prefer-top-level fix moves it into a new import type
Full Changelog: https://github.com/un-ts/eslint-plugin-import-x/compare/v4.17.1...v4.18.0
### Patch Changes - #498 `cf25a01` Thanks @marcalexiei! - fix(extensions): don't require an extension for package subpaths that resolve to a .d.ts (e.
cf25a01 Thanks @marcalexiei! - fix(extensions): don't require an extension for package subpaths that resolve to a .d.ts (e.g. vitest/config)Note: single-segment subpath imports without a slash (e.g. #dep) are still skipped by the existing external-root-module classification; fixing that is
4b2c0c5 Thanks @regseb! - Support RegExp in the import-x/ignore setting and the ignore option of the no-unresolved rule.#494 1c84235 Thanks @morgan-coded! - Fixed no-unresolved crashing when case-sensitive path checks encounter EACCES or EPERM on an ancestor directory.
#481 3e13121 Thanks @B4nan! - fix: memoize legacyNodeResolve resolver to avoid native memory leak
#484 9a07009 Thanks @sairus2k! - Make the extensions rule check Node.js subpath imports (specifiers starting with #, e.g. #utils/helper). Previously parsePath treated a leading # as a URL hash fragment, so the rule skipped extension validation for these imports.
Note: single-segment subpath imports without a slash (e.g. #dep) are still skipped by the existing external-root-module classification; fixing that is deferred to avoid expanding scope.
#468 240ed58 Thanks @silverwind! - Make extensions handle .d.ts correctly
#479 e3cc7e4 Thanks @mrginglymus! - fix: strip querystrings and hash fragments when checking for file existence
#476 fce29b1 Thanks @nbouvrette! - fix(deps): replace @package-json/types with an inline minimal type
Updating the minimum minimatch _10_ version to _10.1.2_ which updates a dependency (@isaacs/brace-expansion) with a critical vulnerability. See
#457 1da4043 Thanks @SukkaW! - Make the no-unused-modules rule 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 new suppressMissingFileEnumeratorAPIWarning rule option (import-x/no-unused-modules: ['error', { suppressMissingFileEnumeratorAPIWarning: true }]).
#450 a51be0f Thanks @andrewgaun! - fix(deps): Bumping minimatch 10 version to avoid dependency with a critical vulnerability
Updating the minimum minimatch 10 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 b669aca Thanks @SukkaW! - Make eslint-plugin-import-x compatible with ESLint's defineConfig
#434 a3aae61 Thanks @stepankuzmin! - fix(deps): replace type-fest with @package-json/types
PackageJson 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 60312ee Thanks @SukkaW! - Bump peer deps version range to include ESLint 10 support
#443 b416a8a Thanks @baevm! - consistent-type-specifier-style: Add exception for TS resolution-mode import attributes
#454 d3f8d67 Thanks @SukkaW! - First step toward ESLint 10 support:
sourceType determination now prefers context.languageOptions when possiblecontext.parserOptions no longer results in crashes with ESLint 10getParser and getParserPath implementations into one getParserOrPath#406 d0a7816 Thanks @marcalexiei! - fix(package): remove config and rules exports pointing to empty files
### Patch Changes - #399 `33f07b4` Thanks @JounQin! - fix: should only use context.physicalFilename as fallback instead of main source - #400 `34adb40
@lnhrdt made their first contribution in https://github.com/un-ts/eslint-plugin-import-x/pull/393
1c8b9ae Thanks @Rel1cx and @JounQin! - feat: port react-x/prefer-react-namespace-import into prefer-namespace-import#393 14cb948 Thanks @lnhrdt and @JounQin! - fix(extensions): always calculate fix option
#388 1089d9f Thanks @JounQin! - fix: take context.cwd into account for cache key
#390 8ca9272 Thanks @scytacki, @JounQin and @arcanis! - fix: pnp issue when used in a monorepo
Full Changelog: https://github.com/un-ts/eslint-plugin-import-x/compare/v4.15.2...v4.16.0
@error-four-o-four made their first contribution in https://github.com/un-ts/eslint-plugin-import-x/pull/378
#378 cdb95ba Thanks @error-four-o-four! - chore: adopt new deprecated: DeprecatedInfo meta rule option
#383 738a7cf Thanks @JounQin! - fix: get npm client and install command correctly
#382 d536756 Thanks @JounQin! - chore: bump unrs-resolver to v1.9.0, it'll fallback to napi-postinstall check at runtime
Full Changelog: https://github.com/un-ts/eslint-plugin-import-x/compare/v4.15.1...v4.15.2
@JoseGoncalves made their first contribution in https://github.com/un-ts/eslint-plugin-import-x/pull/368
#373 90ec1f1 Thanks @JounQin! - chore: migrate stable-hash to stable-hash-x
#371 4f97a1a Thanks @dword-design and @JounQin! - fix: take context.cwd into account for glob options of rules no-extraneous-dependencies and no-unassigned-import
#371 4f97a1a Thanks @JounQin! - fix: enable nocomment: true for glob options of rules no-import-module-exports and no-namespace
#368 74a16c5 Thanks @JoseGoncalves! - fix: drop languageOptions config from flat/recommended
Full Changelog: https://github.com/un-ts/eslint-plugin-import-x/compare/v4.15.0...v4.15.1
### Minor Changes - #362 `8bd40d8` Thanks @JounQin! - refactor: drop @typescript-eslint/utils on production Full Changelog: https://github.com/un-ts/e
@JesseDocken made their first contribution in https://github.com/un-ts/eslint-plugin-import-x/pull/358
#360 3a3f5f8 Thanks @JounQin! - fix: try/catch enumerator.iterateFiles gracefully
#357 46c8bc6 Thanks @JounQin! - chore(deps): bump @typescript-eslint/utils and unrs-resolver
Full Changelog: https://github.com/un-ts/eslint-plugin-import-x/compare/v4.14.1...v4.14.2
### Patch Changes - #355 `81f3d31` Thanks @JounQin! - fix: tslib is no longer used because we're targeting ES2022 Full Changelog: https://github.com/u
@43081j made their first contribution in https://github.com/un-ts/eslint-plugin-import-x/pull/350
#272 43cdd21 Thanks @SukkaW and @JounQin! - feat: map legacy node resolver to the new one with fallback support
#350 12a7cda Thanks @43081j! - Expose flat configs in configs object to allow use of ESLint extends
3bc48fc Thanks @JounQin! - fix: enable nocomment glob option for rule no-unassigned-import's allow optionFull Changelog: https://github.com/un-ts/eslint-plugin-import-x/compare/v4.13.3...v4.14.0
### Patch Changes - #348 `f949929` Thanks @JounQin! - fix(types): exported importX should also have flatConfigs as property Full Changelog: https://gi
### Patch Changes - #344 `2c007d0` Thanks @JounQin! - fix: share same plugin reference for default export - #346 `2991f2e` Thanks @JounQin! - fix: rul
#344 2c007d0 Thanks @JounQin! - fix: share same plugin reference for default export
#346 2991f2e Thanks @JounQin! - fix: rule dynamic-import-chunkname crash due to ts migration
#342 a55dcc7 Thanks @JounQin! - fix(deps): bump eslint-import-context to v0.1.5
Full Changelog: https://github.com/un-ts/eslint-plugin-import-x/compare/v4.13.1...v4.13.2
### Patch Changes - #340 `180785d` Thanks @JounQin! - fix(deps): bump eslint-import-context to v0.1.4 Full Changelog: https://github.com/un-ts/eslint-
### Minor Changes - #335 `371ebee` Thanks @JounQin! - feat: integrate `eslint-import-context` to get rule context without additional params Full Chang
371ebee Thanks @JounQin! - feat: integrate eslint-import-context to get rule context without additional paramsFull Changelog: https://github.com/un-ts/eslint-plugin-import-x/compare/v4.12.2...v4.13.0
### Patch Changes - #332 `0b3809b` Thanks @JounQin! - fix: remove buggy module-sync exports field
### Patch Changes - #329 `4b284cb` Thanks @JounQin! - feat: add suggestions support for extensions unexpected case Full Changelog: https://github.com/
### Minor Changes - #327 `90c1cd0` Thanks @Xunnamius, @stephenjason89 and @JounQin! - feat(extensions): support pathGroupOverrides and fix options Ful
### Patch Changes - #321 `fc4c72c` Thanks @SukkaW! - fix: accept non-array resolver in resolver-next setting
### Minor Changes - #314 `11ebfbd` Thanks @JounQin! - refactor: migrate deprecated doctrine to comment-parser Full Changelog: https://github.com/un-ts
@Shinigami92 made their first contribution in https://github.com/un-ts/eslint-plugin-import-x/pull/307
Full Changelog: https://github.com/un-ts/eslint-plugin-import-x/compare/v4.10.5...v4.10.6
### Patch Changes - #300 `db1824b` Thanks @JounQin! - fix: support run with worker eval Full Changelog: https://github.com/un-ts/eslint-plugin-import-
### Patch Changes - #299 `bf50a4d` Thanks @renovate! - chore(deps): bump @typescript-eslint/utils to v8.30 - #297 `9769f3c` Thanks @JounQin! - fix: su
### Patch Changes - #292 `1342127` Thanks @JounQin! - refactor: remove unnecessary check for pnpapi because unrs-resolver already handles it Full Chan
### Patch Changes - #282 `9f4f213` Thanks @JounQin! - chore: bump unrs-resolver to v1.4.1 Full Changelog: https://github.com/un-ts/eslint-plugin-impor
### Patch Changes - #280 `4966857` Thanks @JounQin! - chore: bump all (dev) deps - #280 `4966857` Thanks @JounQin! - fix: incorrect top level types fi
@jribbens made their first contribution in https://github.com/un-ts/eslint-plugin-import-x/pull/276
Full Changelog: https://github.com/un-ts/eslint-plugin-import-x/compare/v4.9.4...v4.10.0
### Patch Changes - #267 `e9e2300` Thanks @JounQin! - chore: bump unrs-resolver to v1.3.3 Full Changelog: https://github.com/un-ts/eslint-plugin-impor
@karlhorky made their first contribution in https://github.com/un-ts/eslint-plugin-import-x/pull/262
#263 c0046a9 Thanks @JounQin! - chore: migrate to rebranding unrs-resolver with new targets supported:
i686-pc-windows-msvcarmv7-unknown-linux-musleabihfpowerpc64le-unknown-linux-gnus390x-unknown-linux-gnuFull Changelog: https://github.com/un-ts/eslint-plugin-import-x/compare/v4.9.2...v4.9.3
### Patch Changes - #259 `baf7086` Thanks @JounQin! - fix: PluginConfig should use classic config Full Changelog: https://github.com/un-ts/eslint-plug
### Patch Changes - #256 `e66575f` Thanks @JounQin! - refactor: revert picomatch back to minimatch Full Changelog: https://github.com/un-ts/eslint-plu
@TrevorBurnham made their first contribution in https://github.com/un-ts/eslint-plugin-import-x/pull/248
Full Changelog: https://github.com/un-ts/eslint-plugin-import-x/compare/v4.8.1...v4.9.0
### Patch Changes - #251 `af5de32` Thanks @JounQin! - chore: bump `rspack-resolver` to v1.2.0 Full Changelog: https://github.com/un-ts/eslint-plugin-i
af5de32 Thanks @JounQin! - chore: bump rspack-resolver to v1.2.0Full Changelog: https://github.com/un-ts/eslint-plugin-import-x/compare/v4.8.0...v4.8.1
### Minor Changes - #240 `60eb443` Thanks @JounQin! - feat: migrate minimatch to picomatch Full Changelog: https://github.com/un-ts/eslint-plugin-impo
### Patch Changes - #245 `437db59` Thanks @JounQin! - fix: align pnpapi resolved path with enhanced-resolve Full Changelog: https://github.com/un-ts/e
### Patch Changes - #243 `5bc8976` Thanks @JounQin! - fix: use `rspack-resolver` fork for pnp support Full Changelog: https://github.com/un-ts/eslint-
5bc8976 Thanks @JounQin! - fix: use rspack-resolver fork for pnp supportFull Changelog: https://github.com/un-ts/eslint-plugin-import-x/compare/v4.7.0...v4.7.1
default should be last matched, module should be in mainFields.
#238 c8a388d Thanks @JounQin! - fix: change default conditions and mainFields
default should be last matched, module should be in mainFields.
Full Changelog: https://github.com/un-ts/eslint-plugin-import-x/compare/v4.6.1...v4.7.0
### Patch Changes - #211 `be9c3e8` Thanks @mrginglymus! - Fix enhanced-resolve dependency Full Changelog: https://github.com/un-ts/eslint-plugin-impor
So we decided to implement our own resolver that "just works". The new resolver is built upon the `enhanced-resolve` that implements the full Node.js
#209 46d2360 Thanks @SukkaW! - When eslint-plugin-import-x was forked from eslint-plugin-import, we copied over the default resolver (which is eslint-import-resolver-node) as well. However, this resolver doesn't supports exports in the package.json file, and the current maintainer of the eslint-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-resolve that 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 the eslint-import-resolver-node and use this new resolver by default. In the meantime, you can try out this new resolver by setting the import-x/resolver-next option in your eslint.config.js file:
// 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 baseUrl and paths from the tsconfig.json file in this resolver. If you need this feature, please checkout eslint-import-resolver-typescript (also powered by enhanced-resolve), eslint-import-resolver-oxc (powered by oxc-resolver), eslint-import-resolver-next (also powered by oxc-resolver), or other similar resolvers.
Full Changelog: https://github.com/un-ts/eslint-plugin-import-x/compare/v4.5.1...v4.6.0
@voxpelli made their first contribution in https://github.com/un-ts/eslint-plugin-import-x/pull/198
#198 ac6d2e1 Thanks @voxpelli! - Fix #197 with missing types
#204 32e9b55 Thanks @privatenumber! - fix type-import and value-import merging when import-as is used
Full Changelog: https://github.com/un-ts/eslint-plugin-import-x/compare/v4.5.0...v4.5.1
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-ne…
#192 fbf639b Thanks @SukkaW! - The PR implements the new resolver design proposed in https://github.com/un-ts/eslint-plugin-import-x/issues/40#issuecomment-2381444266
eslint-plugin-import-x usersLike the ESLint flat config allows you to use js objects (e.g. import and require) as ESLint plugins, the new eslint-plugin-import-x resolver settings allow you to use js objects as custom resolvers through the new setting import-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-next no 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 with import-x/resolver.
In the next major version of eslint-plugin-import-x (v5), we will rename the currently existing import-x/resolver to import-x/resolver-legacy (which allows the existing ESLint legacy config users to use their existing resolver settings), and import-x/resolver-next will become the new import-x/resolver. When ESLint v9 (the last ESLint version with ESLint legacy config support) reaches EOL in the future, we will remove import-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 importXResolverCompat that you can use in your eslint.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: '' })
];
}
}
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 | ResultFound;
You will be able to import NewResolver from eslint-plugin-import-x/types.
The most notable change is that eslint-plugin-import-x no longer passes the third argument (options) to the resolve function.
We encourage custom resolvers' authors to consume the options outside the actual resolve function implementation. You can export a factory function to accept the options, this factory function will then be called inside the eslint.config.js to 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 resolver function, you will have to create a resolver instance every time the resolve function 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, {});
},
};
};
#184 bc4de89 Thanks @marcalexiei! - fix(no-cycle): improves the type declaration of the rule no-cycle’s maxDepth option
#184 bc4de89 Thanks @marcalexiei! - fix(first): improves the type declaration of the rule first's option
#184 bc4de89 Thanks @marcalexiei! - fix(no-unused-modules): improves the type declaration of the rule no-unused-modules’s missingExports option
#184 bc4de89 Thanks @marcalexiei! - fix(no-deprecated): improve error message when no description is available
Full Changelog: https://github.com/un-ts/eslint-plugin-import-x/compare/v4.4.3...v4.5.0
### Patch Changes - #187 `a428f82` Thanks @SukkaW! - Attach ecmaVersion and sourceType to parserOptions during parse Full Changelog: https://github.co
### Patch Changes - #181 `cc4ee65` Thanks @SukkaW! - Fix #144, read proper sourceType for both eslint flat config and legacy eslintrc config. Full Cha
@teidesu made their first contribution in https://github.com/un-ts/eslint-plugin-import-x/pull/169
9c58269 Thanks @teidesu! - Add new rule option checkTypedImports for extensions, backports https://github.com/import-js/eslint-plugin-import/pull/2817#171 9715220 Thanks @SukkaW! - Perf: avoid regexp during parser choosing
#171 9715220 Thanks @SukkaW! - Add extra guard for rule no-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 9715220 Thanks @SukkaW! - More test cases for no-named-export and no-defualt-export rule specifically with non-module sourceType
#171 9715220 Thanks @SukkaW! - Fix export when there is only one TSDeclareFunction (https://github.com/import-js/eslint-plugin-import/pull/3065)
#171 9715220 Thanks @SukkaW! - Prevent ExportMap's cache is being tainted by incompatible parser (e.g. old babel-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 9715220 Thanks @SukkaW! - Docs: fix a few typos here and there
#168 5de039c Thanks @hyoban! - Fixes https://github.com/un-ts/eslint-plugin-import-x/issues/167, the no-duplicates rule now allows co-existing inline type imports and namespace imports.
#171 9715220 Thanks @SukkaW! - Properly fix espree parser w/ ESLint Flat Config
Full Changelog: https://github.com/un-ts/eslint-plugin-import-x/compare/v4.3.1...v4.4.0
@AaronMoat made their first contribution in https://github.com/un-ts/eslint-plugin-import-x/pull/162
38d0081 Thanks @AaronMoat! - Fix issue where no-duplicates rule with prefer-inline incorrectly marks default type and named type imports as duplicatesFull Changelog: https://github.com/un-ts/eslint-plugin-import-x/compare/v4.3.0...v4.3.1
@jjoselv made their first contribution in https://github.com/un-ts/eslint-plugin-import-x/pull/154
Full Changelog: https://github.com/un-ts/eslint-plugin-import-x/compare/v4.2.1...v4.3.0
@nchevsky made their first contribution in https://github.com/un-ts/eslint-plugin-import-x/pull/147
#148 d228129 Thanks @SukkaW! - Fix newline-after-import's considerComments options when linting require, backports https://github.com/import-js/eslint-plugin-import/pull/2952
#147 eca73ed Thanks @nchevsky! - Fix regression in rule no-unused-modules which would incorrectly initialize option src to [] instead of [process.cwd()], breaking file discovery.
#148 d228129 Thanks @SukkaW! - Fix no-duplicates for TypeScript, backports https://github.com/import-js/eslint-plugin-import/pull/3033
Full Changelog: https://github.com/un-ts/eslint-plugin-import-x/compare/v4.2.0...v4.2.1
@Zamiell made their first contribution in https://github.com/un-ts/eslint-plugin-import-x/pull/142
e5e4580 Thanks @SukkaW! - Fix https://github.com/nuxt/eslint/issues/494 by avoid importing from @typescript-eslint/typescript-estree.Full Changelog: https://github.com/un-ts/eslint-plugin-import-x/compare/v4.1.1...v4.2.0
### Patch Changes - #133 `757ffa9` Thanks @SukkaW! - Fix #123 where the rule no-named-as-default would have confuse TypeScript namespace exports with
```ts import eslintPluginImportX from "eslint-plugin-import-x";
#122 cd52e86 Thanks @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 9948c78 Thanks @SukkaW! - Added no-rename-default that forbid importing a default export by a different name. Originally created by @whitneyit, ported by @SukkaW
Full Changelog: https://github.com/un-ts/eslint-plugin-import-x/compare/v4.0.0...v4.1.0
@merrywhether made their first contribution in https://github.com/un-ts/eslint-plugin-import-x/pull/127
4ba14da Thanks @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.Full Changelog: https://github.com/un-ts/eslint-plugin-import-x/compare/v3.1.0...v4.0.0
A new no-cycle-next rule is being implemented using the graph. It won't be backward compatible with the current rule no-cycle. The current no-cycle ru
#118 0307ff2 Thanks @silverwind! - Reverts #111. The introduction of SCC causes extra overhead that overcomes the early return it introduced.
A new no-cycle-next rule is being implemented using the graph. It won't be backward compatible with the current rule no-cycle. The current no-cycle rule will become no-cycle-legacy in the next major version.
Full Changelog: https://github.com/un-ts/eslint-plugin-import-x/compare/v3.0.1...v3.1.0
### Patch Changes - #109 `fe3121a` Thanks @SukkaW! - Make eslint-plugin-import-x overall faster by refactoring the ExportMap util - #111 `5cce946` Tha
#109 fe3121a Thanks @SukkaW! - Make eslint-plugin-import-x overall faster by refactoring the ExportMap util
#111 5cce946 Thanks @SukkaW! - Drastically improve no-cycle's performance by skipping unnecessary BFSes using Tarjan's SCC.
Full Changelog: https://github.com/un-ts/eslint-plugin-import-x/compare/v3.0.0...v3.0.1
Due to the nature of the fork, all eslint-plugin-import's git tags and releases have been copied over to eslint-plugin-import-x. This causes version c
#106 19f10aa Thanks @SukkaW! - eslint-plugin-import-x is a fork of eslint-plugin-import that 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 to eslint-plugin-import-x. This causes version conflicts when publishing new versions of eslint-plugin-import-x.
To prevent this, we have decided to publish a new major version of eslint-plugin-import-x that will not conflict with the original eslint-plugin-import's versions.
See also https://github.com/un-ts/eslint-plugin-import-x/issues/76
Full Changelog: https://github.com/un-ts/eslint-plugin-import-x/compare/v0.5.3...v3.0.0
@antfu made their first contribution in https://github.com/un-ts/eslint-plugin-import-x/pull/59
#101 c0cea7b Thanks @SukkaW! - Allow incorrect file path in extraneous deps check
#100 293fcf4 Thanks @SukkaW! - feat: webpack comment regex support webpackFetchPriority
#85 ded3e80 Thanks @kosmotema! - add languageOptions to ChildContext
#100 293fcf4 Thanks @SukkaW! - Allow empty chunk name when webpackMode: 'eager' is set; add suggestions to remove name in eager mode
Full Changelog: https://github.com/un-ts/eslint-plugin-import-x/compare/v0.3.1...v0.5.3
### Patch Changes - #93 `64bf1a6` Thanks @SukkaW! - fix: enable isolation parsing w/ typescript-eslint v8
### Patch Changes - #82 `e29ba7f` Thanks @unzico! - fix: cannot find module 'tslib'
### Minor Changes - #66 `49418a0` Thanks @JounQin! - chore(dep)!: drop eslint <8.56 support - #66 `49418a0` Thanks @JounQin! - feat!: upgrade @typescr
One column per month.