sonarjs/no-use-of-empty-return-value
eslint-plugin-sonarjs
No autofixRecommended
eslint.config.js
export default [
{
rules: {
"sonarjs/no-use-of-empty-return-value": "error",
},
},
];The return value of void functions should not be used
function foo() {
console.log("Hello, World!");
}
a = foo();function foo() {
console.log("Hello, World!");
}
foo();Examples from the ESLint documentation.
sonarjs/no-use-of-empty-return-value
eslint-plugin-sonarjs
export default [
{
rules: {
"sonarjs/no-use-of-empty-return-value": "error",
},
},
];Oxlint does not have this rule.
Biome does not have this rule.
Unused local variables and functions should be removed
Errors should not be created without being thrown
Type intersections should use meaningful types