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 Array#{toReversed,toSorted,toSpliced,with} #2030

Merged

Conversation

fisker
Copy link
Collaborator

@fisker fisker commented Feb 1, 2023

Ref: #2029

@fisker fisker marked this pull request as ready for review February 1, 2023 11:01
@fisker fisker marked this pull request as draft February 1, 2023 13:52
@fisker
Copy link
Collaborator Author

fisker commented Feb 1, 2023

Missed .with, don't what was I thinking.

@fisker fisker changed the title no-useless-spread: Check Array#{toReversed,toSorted,toSpliced} no-useless-spread: Check Array#{toReversed,toSorted,toSpliced,with} Feb 2, 2023
@fisker fisker marked this pull request as ready for review February 2, 2023 08:19
@sindresorhus sindresorhus merged commit 55469e5 into sindresorhus:main Feb 2, 2023
@fisker fisker deleted the change-array-by-copy/no-useless-spread branch February 2, 2023 11:30
@boris-petrov
Copy link

@fisker this PR is great and handling [...foo.toSorted()] is awesome, however it would be nice to also handle [...foo].toSorted() and [...foo].sort(), both of which can be replaced with foo.toSorted().

@sindresorhus
Copy link
Owner

@boris-petrov Open a new issue please.

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.

None yet

3 participants