Skip to content

Releases

v4.18.1

Choose a tag to compare

@github-actions github-actions released this 09 Nov 05:07
Immutable release. Only release title and notes can be modified.
522c2c2

Patch Changes

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

New Contributors

Full Changelog: v4.18.0...v4.18.1

v4.18.0

Choose a tag to compare

@github-actions github-actions released this 06 Nov 19:25
Immutable release. Only release title and notes can be modified.
eb711a1

Minor Changes

  • #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:

    • Plain JavaScript is now read with 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.
    • 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.

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

Patch Changes

  • #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 [`0...

Read more

v4.17.1

Choose a tag to compare

@github-actions github-actions released this 28 Jun 07:00
b767b8c

Patch Changes

  • #498 cf25a01 Thanks @marcalexiei! - fix(extensions): don't require an extension for package subpaths that resolve to a .d.ts (e.g. vitest/config)

v4.17.0

Choose a tag to compare

@github-actions github-actions released this 22 Jun 16:26
7578513

Minor Changes

  • #474 4b2c0c5 Thanks @regseb! - Support RegExp in the import-x/ignore setting and the ignore option of the no-unresolved rule.

Patch Changes

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

v4.16.2

Choose a tag to compare

@github-actions github-actions released this 11 Mar 19:22
69ddbba

Patch Changes

  • #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 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 possible
    • Ensure context.parserOptions no longer results in crashes with ESLint 10
    • Merge getParser and getParserPath implementations into one getParserOrPath
  • #406 d0a7816 Thanks @marcalexiei! - fix(package): remove config and rules exports pointing to empty files

v4.16.1

Choose a tag to compare

@github-actions github-actions released this 27 Jun 01:18
e50c5a6

Patch Changes

Full Changelog: v4.16.0...v4.16.1

v4.16.0

Choose a tag to compare

@github-actions github-actions released this 25 Jun 03:47
f91cb36

Minor Changes

Patch Changes

New Contributors

Full Changelog: v4.15.2...v4.16.0

v4.15.2

Choose a tag to compare

@github-actions github-actions released this 11 Jun 22:23
10cf017

Patch Changes

New Contributors

Full Changelog: v4.15.1...v4.15.2

v4.15.1

Choose a tag to compare

@github-actions github-actions released this 05 Jun 14:56
985bb91

Patch Changes

New Contributors

Full Changelog: v4.15.0...v4.15.1

v4.15.0

Choose a tag to compare

@github-actions github-actions released this 31 May 03:34
c568c12

Minor Changes

Full Changelog: v4.14.2...v4.15.0