quick-lint-js

Find bugs in JavaScript programs.

E0097: for loop needs an iterable, or condition and update clauses

There are three kinds of for loops: C-style for loops (;), for-in loops, and for-of loops. It is a syntax error to write a for loop without ;, in, or of:

for (queue.length > 0) {
  process(queue.pop());
}

To fix this error, use a while loop instead of a for loop:

while (queue.length > 0) {
  process(queue.pop());
}

Introduced in quick-lint-js version 0.2.0.

Documentation for other errors