quick-lint-js

Find bugs in JavaScript programs.

E0084: do-while loop needs parentheses around condition

do-while loops have a condition after the while keyword. It is a syntax error to write a condition without ( and ):

let name;
do {
  name = prompt('What is your name?');
} while name === '';

To fix this error, write ( before the condition and ) after the condition:

let name;
do {
  name = prompt('What is your name?');
} while (name === '');

Documentation for other errors