sonarjs/no-redundant-jump
eslint-plugin-sonarjs
SuggestionRecommended
eslint.config.js
export default [
{
rules: {
"sonarjs/no-redundant-jump": "error",
},
},
];function redundantJump(x) {
if (x == 1) {
console.log("x == 1");
return; // Noncompliant
}
}function redundantJump(x) {
if (x == 1) {
console.log("x == 1");
}
}Examples from the ESLint documentation.
sonarjs/no-redundant-jump
eslint-plugin-sonarjs
export default [
{
rules: {
"sonarjs/no-redundant-jump": "error",
},
},
];Oxlint does not have this rule.
Biome does not have this rule.
Boolean literals should not be used in comparisons
Optional properties should not redundantly include 'undefined'
HTTP Referrer-Policy should not be set to an unsafe value
Wrapper objects should not be used for primitive types
Regular expressions should not contain multiple spaces