
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";
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.
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.
}
Features
48d5cc4feat: report references inside IIFEs inno-use-before-define(#21238) (Irfan fandi)a39d9fbfeat: addglobalThistono-obj-calls(#21382) (synthex-byte)66ac583feat: checkyield*expressions inno-unsafe-optional-chaining(#21399) (xbinaryx)
Bug Fixes
Documentation
4783a68docs: Update README (GitHub Actions Bot)43f0ac9docs: clarify parameter description ingetText(#21287) (lumir)
Chores
b59d889chore: update github/codeql-action action to v4.38.3 (#21412) (renovate[bot])95e51a0ci: re-enable@typescript-eslint/typescript-eslintin ecosystem tests (#21410) (Francesco Trotta)317fcb3chore: update ecosystem plugins (#21409) (ESLint Bot)b92decfperf: skip no-redeclare scan for single-declaration variables (#21365) (James Ross)47b7063chore: update dependency @eslint/json to ^2.1.1 (#21398) (renovate[bot])e5aea41chore: update ecosystem plugins (#21390) (ESLint Bot)