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

Rule change proposal: Enforce ... over .split('') in prefer-spread #1440

Closed
fisker opened this issue Jul 22, 2021 · 1 comment · Fixed by #1489
Closed

Rule change proposal: Enforce ... over .split('') in prefer-spread #1440

fisker opened this issue Jul 22, 2021 · 1 comment · Fixed by #1489

Comments

@fisker
Copy link
Collaborator

fisker commented Jul 22, 2021

When splitting string with '', spread should be preferred.

'🦄'.split('')
// -> (2) ['\uD83E', '\uDD84']

[...'🦄']
// -> ['🦄']

Fail

foo.split('');

Pass

[...foo];
@sindresorhus
Copy link
Owner

This is accepted.

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

Successfully merging a pull request may close this issue.

2 participants