Highlights
Stable TypeScript configuration file support
In August of the previous year, ESLint launched support for TypeScript configuration files as an experimental feature.
In order to use a TypeScript configuration file like eslint.config.ts
, users had to specify the unstable_ts_config
flag in the command line, e.g.
npx eslint --flag unstable_ts_config
Following an experimental period of several months, during which there were no specific complaints and only minor adjustments, we have made the decision to officially implement support for TypeScript configuration files as a stable feature.
Starting with ESLint v9.18.0, TypeScript configuration files with extensions .ts
, .mts
and .cts
can be used like regular JavaScript configuration files.
If you are upgrading from a previous version of ESLint, be sure to remove the unstable_ts_config
flag from the command.
Note that in order to use a TypeScript configuration file in Node.js, you still need to have jiti installed in version 2.0 or higher. For Deno and Bun, no additional dependency is necessary. See the documentation about TypeScript Configuration Files for more information about this feature.
no-shadow-restricted-names
checks imports and class names
The no-shadow-restricted-names
rule will now check for restricted names also in import declarations and in class names, for example:
import undefined from "foo";
class NaN {}
This rule was added in ESLint v0.1.4 to report on variables and functions with names that could be confusing to developers like NaN
or undefined
.
As JavaScript evolved, new syntactic constructs were introduced that could accept the same problematic names.
These newer cases are now detected and reported by the rule.
Allowed method names in no-config
problems
The no-console-rule
has been updated to indicate the name of methods that are explicitly configured as allowed when reporting a problem.
This can help developers to find an acceptable alternative to problem reported by this rule.
Consider the following case where no-console
is configured to allow only the warn
and error
methods.
/* eslint no-console: ["error", { allow: ["warn", "error"] }] */
console.log("Some text.");
Previously, the rule would report a problem with the generic message “Unexpected console statement.” In ESLint v9.18.0, the message reads “Unexpected console statement. Only these console methods are allowed: warn, error.”
Features
e84e6e2
feat: Report allowed methods forno-console
rule (#19306) (Anna Bocharova)8efc2d0
feat: unflag TypeScript config files (#19266) (Francesco Trotta)87a9352
feat: check imports and class names inno-shadow-restricted-names
(#19272) (Milos Djermanovic)
Bug Fixes
Documentation
d9c23c5
docs: replacevar
withconst
in rule examples (#19325) (Tanuj Kanti)8e1a898
docs: add tabs to cli code blocks (#18784) (Jay)f3aeefb
docs: rewrite using let and const in rule examples (#19320) (PoloSpark)0b680b3
docs: Update README (GitHub Actions Bot)98c86a9
docs:Edit this page
button link to different branches (#19228) (Tanuj Kanti)6947901
docs: remove hardcoded edit link (#19323) (Milos Djermanovic)03f2f44
docs: rewrite var with const in rules examples (#19317) (Thiago)26c3003
docs: Clarify dangers of eslint:all (#19318) (Nicholas C. Zakas)c038257
docs: addeqeqeq
in related rules tono-eq-null
(#19310) (루밀LuMir)89c8fc5
docs: rewrite examples with var using let and const (#19315) (Amaresh S M)db574c4
docs: add missing backticks tono-void
(#19313) (루밀LuMir)8d943c3
docs: add missing backticks todefault-case-last
(#19311) (루밀LuMir)36ef8bb
docs: rewrite examples with var using let and const (#19298) (Amaresh S M)1610c9e
docs: add missing backticks tono-else-return
(#19309) (루밀LuMir)df409d8
docs: Update README (GitHub Actions Bot)2e84213
docs: Fix Horizontal Scroll Overflow in Rule Description on Mobile View (#19304) (Amaresh S M)6e7361b
docs: replacevar
withlet
andconst
in rule example (#19302) (Tanuj Kanti)069af5e
docs: rewritevar
usingconst
in rule examples (#19303) (Kim GyeonWon)064e35d
docs: remove ‘I hope to’ comments from scope-manager-interface (#19300) (Josh Goldberg ✨)8e00305
docs: replacevar
withconst
in rule examples (#19299) (Tanuj Kanti)a559009
docs: Add warning about extending core rules (#19295) (Nicholas C. Zakas)0bfdf6c
docs: Update README (GitHub Actions Bot)ce0b9ff
docs: add navigation link forcode explorer
(#19285) (Tanuj Kanti)e255cc9
docs: add bluesky icon to footer (#19290) (Tanuj Kanti)5d64851
docs: remove outdated info about environments (#19296) (Francesco Trotta)eec01f0
docs: switch rule examples config format tolanguageOptions
(#19277) (Milos Djermanovic)b36ca0a
docs: Fixing Focus Order by Rearranging Element Sequence (#19241) (Amaresh S M)d122c8a
docs: add missing backticks tosort-imports
(#19282) (루밀LuMir)0367a70
docs: update custom parser docs (#19288) (Francesco Trotta)8c07ebb
docs: addborder-radius
tohX:target
selector styles (#19270) (루밀LuMir)eff7c57
docs: add limitation section inno-loop-func
(#19287) (Tanuj Kanti)5db226f
docs: add missing backticks in various parts of the documentation (#19269) (루밀LuMir)789edbb
docs: Update README (GitHub Actions Bot)613c06a
docs: mark rules that are frozen with ❄️ (#19231) (Amaresh S M)43172ec
docs: Update README (GitHub Actions Bot)ac8b3c4
docs: fix description ofoverrideConfigFile
option (#19262) (Milos Djermanovic)bbb9b46
docs: Update README (GitHub Actions Bot)995b492
docs: fix inconsistent divider in rule categories box (#19249) (Tanuj Kanti)f76d05d
docs: Refactor search result handling with better event listener cleanup (#19252) (Amaresh S M)c5f3d7d
docs: Update README (GitHub Actions Bot)
Chores
c52be85
chore: upgrade to@eslint/js@9.18.0
(#19330) (Francesco Trotta)362099c
chore: package.json update for @eslint/js release (Jenkins)495aa49
chore: extract packagename
frompackage.json
for public interface (#19314) (루밀LuMir)6fe0e72
chore: update dependency @eslint/json to ^0.9.0 (#19263) (renovate[bot])