This rule originally comes from the Airbnb ruleset. These were restricted by Airbnb because browser support was lacking in 2018. Browser support for for...of is now at 97%. Additionally, not all of our users are writing for the browser. Finally, for...of loops are the simplest way to loop through arrays asynchronously in sequence:
// this works, but .forEach and for...in do not
for await (const item of items) {
await doSomething(item);
}
Similarly, this PR allows the use of continue statements. We often encourage early returns in methods, and to me continue is a similar concept, but in the context of a loop. I don't see a need to be opinionated about its usage.
This rule originally comes from the Airbnb ruleset. These were restricted by Airbnb because browser support was lacking in 2018. Browser support for
for...of
is now at 97%. Additionally, not all of our users are writing for the browser. Finally, for...of loops are the simplest way to loop through arrays asynchronously in sequence:Similarly, this PR allows the use of
continue
statements. We often encourage early returns in methods, and to mecontinue
is a similar concept, but in the context of a loop. I don't see a need to be opinionated about its usage.https://caniuse.com/?search=for...of