
Highlights
allowTypeImports option in no-restricted-imports
The no-restricted-imports rule now supports the allowTypeImports option.
When set to true, this will allow type-only imports in TypeScript files while still disallowing regular imports.
For example, the following rule setting permits only type-only imports from the node:assert module:
/*
eslint no-restricted-imports: ["error", {
name: "node:assert",
allowTypeImports: true,
}]
*/
import assert from "node:assert"; // ❌ Incorrect
import type { AssertionError } from "node:assert"; // ✅ Correct
This aligns the no-restricted-imports rule with the corresponding typescript-eslint rule, and continues ESLint’s ongoing efforts to extend TypeScript Syntax support in core rules.
Improved heuristic for --concurrency=auto
After the introduction of multithreaded linting in ESLint v9.34.0, some users running ESLint with the --cache flag reported slower performance when using --concurrency=auto compared to leaving the --concurrency option unset.
The slowdown occurred because ESLint would sometimes enable multithread mode even when most results were already cached, adding unnecessary overhead.
This behavior has been corrected in ESLint v9.37.0, where the heuristic for --concurrency=auto has been improved to better account for cases where increased parallelism provides no benefit.
preserve-caught-error recognizes computed cause property
The preserve-caught-error rule now correctly handles cases where the cause option in a thrown error is expressed using computed property syntax. For example:
try {
// ...
} catch (error) {
throw new Error("Unexpected error!", { ["cause"]: error });
}
Features
39f7fb4feat:preserve-caught-errorshould recognize all static “cause” keys (#20163) (Pixel998)f81eabcfeat: support TS syntax inno-restricted-imports(#19562) (Nitin Kumar)
Bug Fixes
a129ccefix: correctno-loss-of-precisionfalse positives for leading zeros (#20164) (Francesco Trotta)09e04fcfix: add missing AST token types (#20172) (Pixel998)861c6dafix: correctESLinttypings (#20122) (Pixel998)
Documentation
b950359docs: fix typos across the docs (#20182) (루밀LuMir)42498a2docs: improve ToC accessibility by hiding non-semantic character (#20181) (Percy Ma)29ea092docs: Update README (GitHub Actions Bot)5c97a04docs: showavailableUntilin deprecated rule banner (#20170) (Pixel998)90a71bfdocs: updateREADMEfiles to add badge and instructions (#20115) (루밀LuMir)1603ae1docs: update references frommastertomain(#20153) (루밀LuMir)
Chores
afe8a13chore: update@eslint/jsdependency to version 9.37.0 (#20183) (Francesco Trotta)abee4cachore: package.json update for @eslint/js release (Jenkins)fc9381fchore: fix typos in comments (#20175) (overlookmotel)e1574a2chore: unpin jiti (#20173) (renovate[bot])e1ac05erefactor: markESLint.findConfigFile()asasync, add missing docs (#20157) (Pixel998)347906dchore: update eslint (#20149) (renovate[bot])0cb5897test: remove tmp dir created for circular fixes in multithread mode test (#20146) (Milos Djermanovic)bb99566ci: pinjitito version 2.5.1 (#20151) (Pixel998)177f669perf: improve worker count calculation for"auto"concurrency (#20067) (Francesco Trotta)448b57bchore: Mark deprecated formatting rules as available until v11.0.0 (#20144) (Milos Djermanovic)
