sonarjs/no-redundant-parentheses
eslint-plugin-sonarjs
export default [
{
rules: {
"sonarjs/no-redundant-parentheses": "error",
},
},
];This rule is deprecated. Check its documentation for a replacement before enabling it.
let x = (y / 2 + 1); //Compliant even if those parenthesis are useless for the compiler
if (a && ((x+y > 0))) { // Noncompliant
//...
}
return ((x + 1)); // Noncompliantlet x = (y / 2 + 1);
if (a && (x+y > 0)) {
//...
}
return (x + 1);Examples from the ESLint documentation.
No tracked preset enables this rule, so it has no reach yet.
None of the tracked presets enable this rule. Turn it on with the config below.
sonarjs/no-redundant-parentheses
eslint-plugin-sonarjs
export default [
{
rules: {
"sonarjs/no-redundant-parentheses": "error",
},
},
];Oxlint does not have this rule.
Biome does not have this rule.
Increment (++) and decrement (--) operators should not be used in a method call or mixed with other operators in an expression
Test and hook callbacks should use a single completion style