Why does ESLint trigger lint errors on while(true) using fibers? Why does ESLint trigger lint errors on while(true) using fibers? javascript javascript

Why does ESLint trigger lint errors on while(true) using fibers?


These rules about infinite loops are from before generators were a thing and are not even aware of fibers.

Under the assumption that every function never suspends and returns (like a generator, async-keyword function or a fiber) the rule makes a lot of sense to warn against constants in loops.

Now that times have changed - the rule no longer makes sense and what you're doing is perfectly fine.

If we check the eslint repo it was discussed and deemed "not important enough to acknowledge" in the meantime:

I don't think this makes sense as a built-in exception. If you're doing that, then it's best to manually disable the rule in the generator using a comment.

The workaround for(;;) was suggested but everyone involved understands it's a hack for this particular case.

Disable the rule.