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-useless-spread: Check useless "iterable to array" #1414

Merged
merged 11 commits into from
Jul 13, 2021

Conversation

fisker
Copy link
Collaborator

@fisker fisker commented Jul 13, 2021

Fixes #1403

I decide not to check

[...document.querySelectorAll('*')].forEach(() => {})

Because, currently only forEach is available for NodeList, we already have no-array-for-each rule enforce use for...of instead of it, no-array-for-each will fix to

for (const element of [...document.querySelectorAll('*')]);

then it will be reported by this rule, for converting iterable to array in for...of

@fisker fisker marked this pull request as draft July 13, 2021 09:39
@fisker fisker marked this pull request as ready for review July 13, 2021 11:57
@sindresorhus sindresorhus merged commit 61bc6a3 into sindresorhus:main Jul 13, 2021
@fisker fisker deleted the iterable-to-array branch July 14, 2021 02:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rule proposal: no-iterable-to-array
2 participants