prefer-correct-for-loop-increment
preset: recommended
Warns when a for loop increments a wrong variable.
Example
❌ Bad:
void main() {
var j = 1;
for (var i = 0; i < 10; j++) {} // LINT: Incremented variable differs from the declared one. Try checking it for a potential mistake.
}
✅ Good:
void main() {
var j = 1;
for (var i = 0; i < 10; i++) {}
for (var j = 0; j < 10; j++) {}
for (var i = 0; j < 10; j++) {}
}