sonarjs/no-equals-in-for-termination
eslint-plugin-sonarjs
No autofixRecommended
eslint.config.js
export default [
{
rules: {
"sonarjs/no-equals-in-for-termination": "error",
},
},
];Equality operators should not be used in "for" loop termination conditions
for (var i = 1; i != 10; i += 2) // Noncompliant. Infinite; i goes from 9 straight to 11.
{
//...
}for (var i = 1; i <= 10; i += 2) // Compliant
{
//...
}Examples from the ESLint documentation.
sonarjs/no-equals-in-for-termination
eslint-plugin-sonarjs
export default [
{
rules: {
"sonarjs/no-equals-in-for-termination": "error",
},
},
];Oxlint does not have this rule.
Biome does not have this rule.
Test and suite titles should not be empty or whitespace-only
Exclusive tests should not be committed to version control
Parameterized tests should not have empty datasets
Function calls should not pass extra arguments
Regular expressions should not contain empty groups
Switch cases should end with an unconditional "break" statement