sonarjs/no-unused-vars
eslint-plugin-sonarjs
No autofixRecommended
eslint.config.js
export default [
{
rules: {
"sonarjs/no-unused-vars": "error",
},
},
];function numberOfMinutes(hours) {
var seconds = 0; // seconds is never used
return hours * 60;
}function numberOfMinutes(hours) {
return hours * 60;
}Examples from the ESLint documentation.
sonarjs/no-unused-vars
eslint-plugin-sonarjs
export default [
{
rules: {
"sonarjs/no-unused-vars": "error",
},
},
];Oxlint does not have this rule.
Biome does not have this rule.
Disallow unused variable definitions of v-for directives or scope attributes
The return value of void functions should not be used
Errors should not be created without being thrown