
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
- e84e6e2feat: Report allowed methods for- no-consolerule (#19306) (Anna Bocharova)
- 8efc2d0feat: unflag TypeScript config files (#19266) (Francesco Trotta)
- 87a9352feat: check imports and class names in- no-shadow-restricted-names(#19272) (Milos Djermanovic)
Bug Fixes
Documentation
- d9c23c5docs: replace- varwith- constin rule examples (#19325) (Tanuj Kanti)
- 8e1a898docs: add tabs to cli code blocks (#18784) (Jay)
- f3aeefbdocs: rewrite using let and const in rule examples (#19320) (PoloSpark)
- 0b680b3docs: Update README (GitHub Actions Bot)
- 98c86a9docs:- Edit this pagebutton link to different branches (#19228) (Tanuj Kanti)
- 6947901docs: remove hardcoded edit link (#19323) (Milos Djermanovic)
- 03f2f44docs: rewrite var with const in rules examples (#19317) (Thiago)
- 26c3003docs: Clarify dangers of eslint:all (#19318) (Nicholas C. Zakas)
- c038257docs: add- eqeqeqin related rules to- no-eq-null(#19310) (루밀LuMir)
- 89c8fc5docs: rewrite examples with var using let and const (#19315) (Amaresh S M)
- db574c4docs: add missing backticks to- no-void(#19313) (루밀LuMir)
- 8d943c3docs: add missing backticks to- default-case-last(#19311) (루밀LuMir)
- 36ef8bbdocs: rewrite examples with var using let and const (#19298) (Amaresh S M)
- 1610c9edocs: add missing backticks to- no-else-return(#19309) (루밀LuMir)
- df409d8docs: Update README (GitHub Actions Bot)
- 2e84213docs: Fix Horizontal Scroll Overflow in Rule Description on Mobile View (#19304) (Amaresh S M)
- 6e7361bdocs: replace- varwith- letand- constin rule example (#19302) (Tanuj Kanti)
- 069af5edocs: rewrite- varusing- constin rule examples (#19303) (Kim GyeonWon)
- 064e35ddocs: remove ‘I hope to’ comments from scope-manager-interface (#19300) (Josh Goldberg ✨)
- 8e00305docs: replace- varwith- constin rule examples (#19299) (Tanuj Kanti)
- a559009docs: Add warning about extending core rules (#19295) (Nicholas C. Zakas)
- 0bfdf6cdocs: Update README (GitHub Actions Bot)
- ce0b9ffdocs: add navigation link for- code explorer(#19285) (Tanuj Kanti)
- e255cc9docs: add bluesky icon to footer (#19290) (Tanuj Kanti)
- 5d64851docs: remove outdated info about environments (#19296) (Francesco Trotta)
- eec01f0docs: switch rule examples config format to- languageOptions(#19277) (Milos Djermanovic)
- b36ca0adocs: Fixing Focus Order by Rearranging Element Sequence (#19241) (Amaresh S M)
- d122c8adocs: add missing backticks to- sort-imports(#19282) (루밀LuMir)
- 0367a70docs: update custom parser docs (#19288) (Francesco Trotta)
- 8c07ebbdocs: add- border-radiusto- hX:targetselector styles (#19270) (루밀LuMir)
- eff7c57docs: add limitation section in- no-loop-func(#19287) (Tanuj Kanti)
- 5db226fdocs: add missing backticks in various parts of the documentation (#19269) (루밀LuMir)
- 789edbbdocs: Update README (GitHub Actions Bot)
- 613c06adocs: mark rules that are frozen with ❄️ (#19231) (Amaresh S M)
- 43172ecdocs: Update README (GitHub Actions Bot)
- ac8b3c4docs: fix description of- overrideConfigFileoption (#19262) (Milos Djermanovic)
- bbb9b46docs: Update README (GitHub Actions Bot)
- 995b492docs: fix inconsistent divider in rule categories box (#19249) (Tanuj Kanti)
- f76d05ddocs: Refactor search result handling with better event listener cleanup (#19252) (Amaresh S M)
- c5f3d7ddocs: Update README (GitHub Actions Bot)
Chores
- c52be85chore: upgrade to- @eslint/js@9.18.0(#19330) (Francesco Trotta)
- 362099cchore: package.json update for @eslint/js release (Jenkins)
- 495aa49chore: extract package- namefrom- package.jsonfor public interface (#19314) (루밀LuMir)
- 6fe0e72chore: update dependency @eslint/json to ^0.9.0 (#19263) (renovate[bot])
