ESLint Blog

ESLint v10.13.0 released

Read the original on eslint.org ↗

Highlights

Several core rules have been updated to report more linting problems.

no-use-before-define

The no-use-before-define rule has been updated to account for the fact that IIFEs execute immediately by treating them as part of the execution context where they are defined and called.

This change can produce more linting errors in cases such as the following:

/* eslint no-use-before-define: ["error", { variables: false }] */

(() => {
    console.log(foo); // 'foo' was used before it was defined.
})();

const foo = "bar";
1234567
Copy code to clipboard

no-obj-calls

The no-obj-calls rule has been updated to report calls to globalThis.

/* eslint no-obj-calls: "error" */

const foo = globalThis(); // 'globalThis' is not a function.

const bar = new globalThis(); // 'globalThis' is not a function.
12345
Copy code to clipboard

no-unsafe-optional-chaining

The no-unsafe-optional-chaining rule has been updated to report unsafe usage of optional chaining in arguments of yield*.

/* eslint no-unsafe-optional-chaining: "error" */

function* gen() {
    yield* obj?.foo; // Unsafe usage of optional chaining. If it short-circuits with 'undefined' the evaluation will throw TypeError.
}
12345
Copy code to clipboard

Features

Bug Fixes

Documentation

  • 4783a68 docs: Update README (GitHub Actions Bot)
  • 43f0ac9 docs: clarify parameter description in getText (#21287) (lumir)

Chores

  • b59d889 chore: update github/codeql-action action to v4.38.3 (#21412) (renovate[bot])
  • 95e51a0 ci: re-enable @typescript-eslint/typescript-eslint in ecosystem tests (#21410) (Francesco Trotta)
  • 317fcb3 chore: update ecosystem plugins (#21409) (ESLint Bot)
  • b92decf perf: skip no-redeclare scan for single-declaration variables (#21365) (James Ross)
  • 47b7063 chore: update dependency @eslint/json to ^2.1.1 (#21398) (renovate[bot])
  • e5aea41 chore: update ecosystem plugins (#21390) (ESLint Bot)