Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no-restricted-syntax for...of warning potentially confusing #2428

Open
gpoole opened this issue May 18, 2021 · 2 comments
Open

no-restricted-syntax for...of warning potentially confusing #2428

gpoole opened this issue May 18, 2021 · 2 comments

Comments

@gpoole
Copy link

gpoole commented May 18, 2021

The warning about using for...of states that regenerator-runtime is required:

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.

The explanation creates the impression regenerator-runtime is essential for any code using for...of, which is no longer true, as for...of seems to be fairly widely supported.

I think it could make sense to reword the explanation to state that regenerator may be required and that imperative loops should be avoided.

@ljharb
Copy link
Collaborator

ljharb commented May 18, 2021

It’s still true if you support older browsers, which most companies do indeed have to do.

It’s fine to improve the message tho.

ANaphade added a commit to ANaphade/javascript that referenced this issue May 22, 2022
@ANaphade
Copy link

ANaphade commented May 22, 2022

Rephrased the message and sent PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants
@ljharb @gpoole @ANaphade and others