Fix `for` counter direction

JavaScript pattern

If a for counter moves in the wrong direction the loop will run infinitely. Mostly, an infinite for loop is a typo and causes a bug.


Apply with the Grit CLI
grit apply for_direction

Transform for counter for </<= directions

BEFORE
for (var i = 0; i < 10; i--) {
  doSomething(i);
}
AFTER
for (var i = 0; i < 10; i++) {
  doSomething(i);
}

Transform for counter for >/>= directions

BEFORE
for (var i = 10; i >= 0; i++) {
  doSomething(i);
}
AFTER
for (var i = 10; i >= 0; i--) {
  doSomething(i);
}

Transform counter for </<= directions

BEFORE
for (var i = 0; 10 > i; i--) {
  doSomething(i);
}
AFTER
for (var i = 0; 10 > i; i++) {
  doSomething(i);
}

Do not change for counter

JAVASCRIPT
for (var i = 0; i < 10; i++) {}