Repository navigation
Releases
v4.18.1
Patch Changes
-
#599
d9c8a4eThanks @SwastikTripathi! - fix(core): don't load the optional@typescript-eslint/utilspeer at runtime, so the plugin loads again without it -
#604
28779e0Thanks @gilbarbara! - fix(extensions): stop requiring ajsalias on extensionless imports that resolve to a file whose extension isnever, such as.tswith{ js: 'always', ts: 'never' }. -
#600
6172d1dThanks @thekhegay! - fix(first): the autofix puts imports above the decorators of@dec() export classand on their own line when they have no semicolon, it could leave code that doesn't parse in both cases
New Contributors
- @gilbarbara made their first contribution in #604
Full Changelog: v4.18.0...v4.18.1
v4.18.0
Minor Changes
-
#520
802441cThanks @SwastikTripathi! - Add acheckSelfReferenceoption to theextensionsrule. When set, a package's import of its own subpath export (e.g.pkg/subfrom insidepkg) is treated as a package import, soignorePackagesapplies to it. -
#403
f4d0a4bThanks @Zamiell! -extensions: when an import has no extension and cannot be resolved as-is, try the extensions configured asalwaysinpatternand 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 themissingmessage instead of only reporting a bare missing extension. -
#572
fc17206Thanks @SwastikTripathi! - feat(no-duplicates): add awhitelistoption listing entry points that share one declaration file but are different modules, such assvelteandsvelte/easing -
#504
f10dcc4Thanks @morgan-coded! - Add a"top"mode to theorderrule'swarnOnUnassignedImportsoption for requiring no-specifier ESM imports before assigned imports. -
#502
9c85cedThanks @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 fromnode_modules.That core has been rewritten:
- Plain JavaScript is now read with
es-module-lexerinstead of being parsed. Anything it can't read faithfully — TypeScript, JSX, Flow — still goes through the ESLint parser exactly as before. - Analysis is lazy. Much of the work now happens when a rule actually asks for it, so enabling one rule no longer pays for what the others would have needed.
- Results are cached and shared between rules.
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.
- Plain JavaScript is now read with
-
#456
7b78aaeThanks @43081j! - Add four barrel file detection rules ported fromeslint-plugin-barrel-files:avoid-barrel-files,avoid-importing-barrel-files,avoid-namespace-importandavoid-re-export-all.avoid-importing-barrel-fileschecks every runtime way a module can be referenced — static imports, re-exports (export … from,export * from,export * as ns from), dynamicimport()and CommonJSrequire()— with type-only statements exempt. -
#157
89cfe42Thanks @Zamiell! - feat(no-rename-default): accept names derived from bare package paths and add awhitelistoption for modules that mangle their default export names
Patch Changes
-
#562
7cbe683Thanks @JounQin! - perf(avoid-importing-barrel-files): skip the surface parse for a dependency that cannot be a barrelThe 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 ofexport default { … }are exports no entry count can see (a
defaultthatesModuleInteropsynthesizes 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
225a5aaThanks @SwastikTripathi! - Fixno-extraneous-dependenciestelling you to add a package that is already indevDependenciesoroptionalDependencieswhen its import resolves through@types/* -
#579
db16385Thanks @thekhegay! - fix(core): keep the size ofsettingsout of module and resolver cache keysEvery key held the full
stableHashtext ofsettings,parserOptionsand the parser. One large value in sharedsettings, like a custom alphabet fromeslint-plugin-perfectionist, was copied into each key on every resolve, sono-cycleand any other rule that resolves imports could run out of memory. Keys now hold a short id per distinct hash. -
#309
4b9ea02Thanks @remcohaszing! - Allow packages to import themselves inimport-x/no-extraneous-dependencieswhen theexportsfield is defined inpackage.json; importing a package's own name withoutexportsis reported by the newselfImportmessage. -
#565
3d0f5a9Thanks @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
bb7b18bThanks @SwastikTripathi! - chore(deps): upgradees-module-lexerfrom v2 to v3. The v3 API is a complete redesign using discriminated union types (StaticImport | DynamicImport | ImportMetaReffor imports,DirectExport | Reexport | ReexportAllfor exports) replacing numericdfields and short property names. The lexer route now resolvesexport { x }wherexcomes from a non-namespace import as a reexport rather than an own export, which is more semantically accurate. -
#566
4c66c87Thanks @SwastikTripathi! - fix(export): don't report a namespace that only declares types as a duplicate of a value with the same name -
#536
db674b5Thanks @SukkaW! - fix(export): check types and values separatelyexport type * fromonly re-exports types, so it no longer conflicts with a value export of the same name, and a type reached throughexport *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 [`0...
v4.17.1
Patch Changes
- #498
cf25a01Thanks @marcalexiei! - fix(extensions): don't require an extension for package subpaths that resolve to a.d.ts(e.g.vitest/config)
v4.17.0
Minor Changes
- #474
4b2c0c5Thanks @regseb! - SupportRegExpin theimport-x/ignoresetting and theignoreoption of theno-unresolvedrule.
Patch Changes
-
#494
1c84235Thanks @morgan-coded! - Fixedno-unresolvedcrashing when case-sensitive path checks encounterEACCESorEPERMon an ancestor directory. -
#481
3e13121Thanks @B4nan! - fix: memoize legacyNodeResolve resolver to avoid native memory leak -
#484
9a07009Thanks @sairus2k! - Make theextensionsrule check Node.js subpath imports (specifiers starting with#, e.g.#utils/helper). PreviouslyparsePathtreated 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
240ed58Thanks @silverwind! - Makeextensionshandle.d.tscorrectly -
#479
e3cc7e4Thanks @mrginglymus! - fix: strip querystrings and hash fragments when checking for file existence -
#476
fce29b1Thanks @nbouvrette! - fix(deps): replace @package-json/types with an inline minimal type
v4.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 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
v4.16.1
v4.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 @scytacki, @JounQin and @arcanis! - fix: pnp issue when used in a monorepo
New Contributors
Full Changelog: v4.15.2...v4.16.0
v4.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
New Contributors
- @error-four-o-four made their first contribution in #378
Full Changelog: v4.15.1...v4.15.2
v4.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
New Contributors
- @JoseGoncalves made their first contribution in #368
- @dword-design made their first contribution in #371
Full Changelog: v4.15.0...v4.15.1
v4.15.0
Minor Changes
Full Changelog: v4.14.2...v4.15.0