sonarjs/no-useless-increment
eslint-plugin-sonarjs
No autofixRecommended
eslint.config.js
export default [
{
rules: {
"sonarjs/no-useless-increment": "error",
},
},
];function pickNumber() {
let i = 0;
i = i++; // Noncompliant; i is still zero
return i++; // Noncompliant; 0 returned
}function pickNumber() {
let i = 0;
i++;
return ++i;
}Examples from the ESLint documentation.
sonarjs/no-useless-increment
eslint-plugin-sonarjs
export default [
{
rules: {
"sonarjs/no-useless-increment": "error",
},
},
];Oxlint does not have this rule.
Biome does not have this rule.
Type intersections should use meaningful types
The return value of void functions should not be used
React state setter function should not be called with its matching state variable
Unused local variables and functions should be removed
Vue components should not use the deprecated "vue-class-component" or "vue-property-decorator" libraries