
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
39f7fb4
feat:preserve-caught-error
should recognize all static “cause” keys (#20163) (Pixel998)f81eabc
feat: support TS syntax inno-restricted-imports
(#19562) (Nitin Kumar)
Bug Fixes
a129cce
fix: correctno-loss-of-precision
false positives for leading zeros (#20164) (Francesco Trotta)09e04fc
fix: add missing AST token types (#20172) (Pixel998)861c6da
fix: correctESLint
typings (#20122) (Pixel998)
Documentation
b950359
docs: fix typos across the docs (#20182) (루밀LuMir)42498a2
docs: improve ToC accessibility by hiding non-semantic character (#20181) (Percy Ma)29ea092
docs: Update README (GitHub Actions Bot)5c97a04
docs: showavailableUntil
in deprecated rule banner (#20170) (Pixel998)90a71bf
docs: updateREADME
files to add badge and instructions (#20115) (루밀LuMir)1603ae1
docs: update references frommaster
tomain
(#20153) (루밀LuMir)
Chores
afe8a13
chore: update@eslint/js
dependency to version 9.37.0 (#20183) (Francesco Trotta)abee4ca
chore: package.json update for @eslint/js release (Jenkins)fc9381f
chore: fix typos in comments (#20175) (overlookmotel)e1574a2
chore: unpin jiti (#20173) (renovate[bot])e1ac05e
refactor: markESLint.findConfigFile()
asasync
, add missing docs (#20157) (Pixel998)347906d
chore: update eslint (#20149) (renovate[bot])0cb5897
test: remove tmp dir created for circular fixes in multithread mode test (#20146) (Milos Djermanovic)bb99566
ci: pinjiti
to version 2.5.1 (#20151) (Pixel998)177f669
perf: improve worker count calculation for"auto"
concurrency (#20067) (Francesco Trotta)448b57b
chore: Mark deprecated formatting rules as available until v11.0.0 (#20144) (Milos Djermanovic)