chore: allow for-of loops
Description
This MR removes the eslint restricted syntax rule that prevented us from using for of
loops.
{
selector: 'ForOfStatement',
message: 'iterators/generators require regenerator-runtime, which is too heavyweight for this guide to allow them. Separately, loops should be avoided in favor of array iterations.',
},
We target node 18 and whatever electron (chromium) that VS Code uses. The (asynchronous) for-of
are natively supported for many years now and since we don't have to support legacy browsers, we don't have to worry about babel (which we don't use) having to include regenerator-runtime.
Support
- https://caniuse.com/mdn-javascript_statements_for_await_of
- https://caniuse.com/mdn-javascript_statements_for_of_closing_iterators
Related Issues
- https://github.com/airbnb/javascript/issues/2428
- https://github.com/airbnb/javascript/issues/1271#issuecomment-548688952
Types of changes
-
Bug fix (non-breaking change which fixes an issue) -
New feature (non-breaking change which adds functionality) -
Breaking change (fix or feature that would cause existing functionality to change) -
Documentation -
Chore (Related to CI or Packaging to platforms) -
Test gap