sonarjs/no-nested-incdec
eslint-plugin-sonarjs
No autofix
eslint.config.js
export default [
{
rules: {
"sonarjs/no-nested-incdec": "error",
},
},
];Increment (++) and decrement (--) operators should not be used in a method call or mixed with other operators in an expression
u8a = ++u8b + u8c--;
foo = bar++ / 4;++u8b;
u8a = u8b + u8c;
u8c--;
foo = bar / 4;
bar++;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-nested-incdec
eslint-plugin-sonarjs
export default [
{
rules: {
"sonarjs/no-nested-incdec": "error",
},
},
];Oxlint does not have this rule.
Biome does not have this rule.
Test and hook callbacks should use a single completion style