New Dec 13, 2024

ESLint v9.17.0 released

Libraries, Frameworks, etc. All from ESLint Blog View ESLint v9.17.0 released on eslint.org

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

Bug Fixes

Documentation

Chores

Scroll to top