Skip to main content

js/useWhile

MISSING DOCUMENTATION

Examples

Invalid

for (; x.running;) {
  x.step();
}

 file.ts:1 lint/js/useWhile  FIXABLE  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

  Use while loops instead of for loops.

  > 1for (; x.running;) {
     ^^^^^^^^^^^^^^^^^^^^
  > 2  x.step();
  > 3}
     ^

  Safe fix

    1  - for·(;·x.running;·)·{
      1+ while·(x.running)·{
    2 2  x.step();
    3 3  }


for (;;) {
  doSomething();
}

 file.ts:1 lint/js/useWhile  FIXABLE  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

  Use while loops instead of for loops.

  > 1for (;;) {
     ^^^^^^^^^^
  > 2  doSomething();
  > 3}
     ^

  Safe fix

    1  - for·(;;)·{
      1+ while·(true)·{
    2 2  doSomething();
    3 3  }