JavaScript has 6 kind of loops. We don't really need all of them. Just allow 2 of them (by default) is enough.
Loop | Example | Allow(by default) |
---|---|---|
while | while(true){} |
β |
for-of | for(const foo of bar){} |
β |
for | for(let i=0;i<10;i++){} |
β |
for-in | for(const foo in bar){} |
β |
do-while | do{}while(foo<bar) |
β |
for-await-of | for await (const num of foo()){} |
β |
This rule provide an options: restricted-loops
, defaults to ['for','for-in','do-while','for-await-of']
See Description.
See Description.
no-restricted-loops
No response
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too