ESLint v8.x reached end-of-life on 2024-10-05 and is no longer maintained. Upgrade or consider long-term support options

ESLint v9.18.0 released

We just pushed ESLint v9.18.0, which is a minor release upgrade of ESLint. This release adds some new features and fixes several bugs found in the previous release.

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 {}

Playground Link

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.”

Playground Link

Features

Bug Fixes

  • da768d4 fix: correct overrideConfigFile type (#19289) (Francesco Trotta)

Documentation

  • d9c23c5 docs: replace var with const 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: add eqeqeq in related rules to no-eq-null (#19310) (루밀LuMir)
  • 89c8fc5 docs: rewrite examples with var using let and const (#19315) (Amaresh S M)
  • db574c4 docs: add missing backticks to no-void (#19313) (루밀LuMir)
  • 8d943c3 docs: add missing backticks to default-case-last (#19311) (루밀LuMir)
  • 36ef8bb docs: rewrite examples with var using let and const (#19298) (Amaresh S M)
  • 1610c9e docs: add missing backticks to no-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: replace var with let and const in rule example (#19302) (Tanuj Kanti)
  • 069af5e docs: rewrite var using const in rule examples (#19303) (Kim GyeonWon)
  • 064e35d docs: remove ‘I hope to’ comments from scope-manager-interface (#19300) (Josh Goldberg ✨)
  • 8e00305 docs: replace var with const 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 for code 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 to languageOptions (#19277) (Milos Djermanovic)
  • b36ca0a docs: Fixing Focus Order by Rearranging Element Sequence (#19241) (Amaresh S M)
  • d122c8a docs: add missing backticks to sort-imports (#19282) (루밀LuMir)
  • 0367a70 docs: update custom parser docs (#19288) (Francesco Trotta)
  • 8c07ebb docs: add border-radius to hX:target selector styles (#19270) (루밀LuMir)
  • eff7c57 docs: add limitation section in no-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 of overrideConfigFile 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 package name from package.json for public interface (#19314) (루밀LuMir)
  • 6fe0e72 chore: update dependency @eslint/json to ^0.9.0 (#19263) (renovate[bot])

The latest ESLint news, case studies, tutorials, and resources.

ESLint v9.17.0 released
2 min read

ESLint v9.17.0 released

We just pushed ESLint v9.17.0, which is a minor release upgrade of ESLint. This release adds some new features and fixes several bugs found in the previous release.

ESLint v9.16.0 released
2 min read

ESLint v9.16.0 released

We just pushed ESLint v9.16.0, which is a minor release upgrade of ESLint. This release adds some new features and fixes several bugs found in the previous release.

ESLint v9.15.0 released
2 min read

ESLint v9.15.0 released

We just pushed ESLint v9.15.0, which is a minor release upgrade of ESLint. This release adds some new features and fixes several bugs found in the previous release.