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

Highlights

ignoreComputedKeys option for sort-keys

This release adds a new boolean option ignoreComputedKeys to the sort-keys rule. ignoreComputedKeys allows a more consistent sorting of properties with non-computed names by treating computed keys as group separators rather than part of a group. The following example shows the expected sorting of properties in an object literal without the ignoreComputedKeys option.

with ignoreComputedKeys: false (default)

const obj = { a: 10, b: 20, [c]: 7.5, d: 15 };

When ignoreComputedKeys is set to true, the computed key c can appear anywhere in the literal, as long as the other groups of properties are sorted.

with ignoreComputedKeys: true

const obj = { a: 10, b: 20, [c]: 7.5, d: 15 };

or

const obj = { d: 15, [c]: 7.5, a: 10, b: 20 };

or

const obj = { a: 10, b: 20, d: 15, [c]: 7.5 };

etc.

Language-agnostic no-restricted-syntax

Another enhancement in this release is the ability to use the no-restricted-syntax rule with any language. This was already possible in previous releases, but now usage with language plugins is officially supported and documented.

When linting JSON files with the @eslint/json plugin, a config that warns about the usage of null could look like this:

import json from "@eslint/json";

export default [
{
files: ["**/*.json"],
language: "json/json",
plugins: {
json,
},
rules: {
"no-restricted-syntax": [
"warn",
"Null" // AST selector for `null`
],
},
},
];

If you would like to restrict syntax in your project based on AST selectors but you’re unsure what nodes represent a particular code, we recommend using Code Explorer.

Features

Documentation

Chores

  • feb703b chore: upgrade to @eslint/js@9.16.0 (#19195) (Francesco Trotta)
  • df9bf95 chore: package.json update for @eslint/js release (Jenkins)
  • f831893 chore: add type for ignoreComputedKeys option of sort-keys (#19184) (Tanuj Kanti)
  • 3afb8a1 chore: update dependency @eslint/json to ^0.8.0 (#19177) (Milos Djermanovic)
  • 1f77c53 chore: add repository.directory property to package.json (#19165) (루밀LuMir)
  • d460594 chore: update dependency @arethetypeswrong/cli to ^0.17.0 (#19147) (renovate[bot])
  • 45cd4ea refactor: update default options in rules (#19136) (Milos Djermanovic)

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

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.

ESLint v9.14.0 released
2 min read

ESLint v9.14.0 released

We just pushed ESLint v9.14.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.13.0 released
1 min read

ESLint v9.13.0 released

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