
Highlights
no-unused-vars Suggestions
The no-unused-vars rule provides suggestions now! When the rule sees code with an unused variable like this:
const a = "Hello";
const b = "World!";
console.log(a);It will now suggest removing the unused variable declaration:
const a = "Hello";
console.log(a);Suggestions also work for more complex cases like unused function arguments, destructuring syntax, etc.
function avg(a, b, c) {
    return (a + b) / 2;
}
console.log(avg(12, 13, 25));after the suggestion is applied becomes:
function avg(a, b) {
    return (a + b) / 2;
}
console.log(avg(12, 13, 25));and
const [{ status, value, reason }] = await Promise.allSettled([promise1, promise2]);
if (status === "rejected") {
    throw reason;
}after the suggestion becomes:
const [{ status, reason }] = await Promise.allSettled([promise1, promise2]);
if (status === "rejected") {
    throw reason;
}no-unused-vars suggestions mark the completion of months of work. We will likely further improve and fine-tune this feature in future updates.
Nullish message.fix Allowed
Previously, if a processor returned a LintMessage with a fix property set to undefined or null, ESLint would crash with an unhelpful error message when trying to apply the autofix.
This problem has been fixed in the current release.
Features
- eed91d1feat: add suggestions to- no-unused-vars(#18352) (Tanuj Kanti)
Bug Fixes
- 67d683dfix: fix crash when- message.fixis nullish (#19168) (ntnyq)
- c618707fix: ignore vars with non-identifier references in no-useless-assignment (#19200) (YeonJuan)
Documentation
- 3c22d2adocs: update- yodato- Yodain [- yoda](/docs/rules/yoda).mdfor consistency (#19230) (루밀LuMir)
- e0a2203docs: add missing backticks to- no-sequences(#19233) (루밀LuMir)
- 4cc4881docs: Update README (GitHub Actions Bot)
- 3db6fdfdocs: [no-await-in-loop] expand on benefits and inapplicability (#19211) (Kirk Waiblinger)
- bf2a4f6docs: add missing backticks to- func-style(#19227) (루밀LuMir)
- ba098bddocs: add missing header to- prefer-spread(#19224) (루밀LuMir)
- b607ae6docs: update description of- no-param-reassign(#19220) (루밀LuMir)
- 1eb424ddocs: add missing backticks to- prefer-destructuring(#19223) (루밀LuMir)
- 85998d1docs: add missing backticks to- no-unneeded-ternary(#19222) (루밀LuMir)
- b75b32cdocs: add missing backticks to- no-new-func(#19219) (루밀LuMir)
- a7700bcdocs: add missing backticks to- id-length(#19217) (루밀LuMir)
- e2bb429docs: add missing backticks to [- complexity](/docs/rules/complexity).md(#19214) (루밀LuMir)
- 045d716docs: add missing- )to- id-denylist(#19213) (루밀LuMir)
- 7fe4114docs: Update README (GitHub Actions Bot)
- c743ba6docs: add CSS language to- no-restricted-syntax(#19208) (Milos Djermanovic)
- 1416d70docs: add missing backticks to- eqeqeq(#19207) (루밀LuMir)
- b950c1bdocs: add missing backticks to- prefer-object-spread(#19206) (루밀LuMir)
- 8a941cbdocs: update docs and- descriptionof- require-unicode-regexp(#19205) (루밀LuMir)
- cbab228docs: Update README (GitHub Actions Bot)
- f2257cedocs: update comments and- descriptionof- no-script-url(#19203) (루밀LuMir)
- 365f0f4docs: add missing backtick to- default-case-last(#19202) (루밀LuMir)
- e6b84f5docs: add missing punctuation in document (#19161) (루밀LuMir)
- c88708edocs: replace quote with backtick in- descriptionof- for-direction(#19199) (루밀LuMir)
- a76f233docs: use higher contrast color tokens for code comments (#19187) (Josh Goldberg ✨)
- db19502docs: Update README (GitHub Actions Bot)
Chores
- cc243c9chore: upgrade to- @eslint/js@9.17.0(#19242) (Francesco Trotta)
- 84c5787chore: package.json update for @eslint/js release (Jenkins)
- 4c4f53bchore: add missing backticks to- flags.js(#19226) (루밀LuMir)
- 4b3132cchore: update dependency eslint-plugin-expect-type to ^0.6.0 (#19221) (renovate[bot])
- 9bf2204chore: add type definitions for the- eslint-config-eslintpackage (#19050) (Arya Emami)
- ee8c220chore: fix incorrect- nameproperty in- integration-tutorial-code(#19218) (루밀LuMir)
- cca801dchore: Upgrade cross-spawn to 7.0.6 (#19185) (folortin)
