Skip to content

Avoid-Infinite-Loops

Documentation Index

Fetch the complete documentation index at: https://docs.sourcery.ai/llms.txt

Use this file to discover all available pages before exploring further.

Avoid loops with missing or constant end conditions.

for (;;) {console.log("forever")}

Loops with a constant condition, or no terminator, can be useful in certain contexts, but it’s easy to forget to break out of them. This rule highlights loops which may never end.