You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
no-for-loop can be removed if this rule is implemented. no-for-loop will do auto-fixing. I don't think we need to do auto-fixing in this rule. Auto-fixing make this rule complex to understand.
Description
JavaScript has 6 kind of loops. We don't really need all of them. Just allow 2 of them (by default) is enough.
while(true){}
for(const foo of bar){}
for(let i=0;i<10;i++){}
for(const foo in bar){}
do{}while(foo<bar)
for await (const num of foo()){}
This rule provide an options:
restricted-loops
, defaults to['for','for-in','do-while','for-await-of']
Fail
See Description.
Pass
See Description.
Proposed rule name
no-restricted-loops
Additional Info
No response
The text was updated successfully, but these errors were encountered: