sonarjs/for-loop-increment-sign
eslint-plugin-sonarjs
No autofixRecommended
eslint.config.js
export default [
{
rules: {
"sonarjs/for-loop-increment-sign": "error",
},
},
];A "for" loop update clause should move the counter in the right direction
for (var i = 0; i < strings.length; i--) { // Noncompliant;
//...
}for (var i = 0; i < strings.length; i++) {
//...
}Examples from the ESLint documentation.
sonarjs/for-loop-increment-sign
eslint-plugin-sonarjs
export default [
{
rules: {
"sonarjs/for-loop-increment-sign": "error",
},
},
];Oxlint does not have this rule.
Biome does not have this rule.
Functions should not be defined inside loops
Functions should always return the same type
File permissions should not be set to world-accessible values
Future reserved words should not be used as identifiers