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

Add auto-fix for no-unreadable-array-destructuring #1010

Merged

Conversation

fisker
Copy link
Collaborator

@fisker fisker commented Jan 12, 2021

Only if single element(or rest elements) in VariableDeclarator is fixable.

Fixes #746

@fisker fisker force-pushed the no-unreadable-array-destructuring-fix branch from 922fe6e to 52068ef Compare January 12, 2021 08:54
@fisker fisker marked this pull request as ready for review January 12, 2021 08:58
@sindresorhus sindresorhus merged commit 27bc3c3 into sindresorhus:master Jan 14, 2021
@sindresorhus
Copy link
Owner

Are there some unsafe cases we could add suggestions for?

@fisker
Copy link
Collaborator Author

fisker commented Jan 14, 2021

yes, but not real world case....

const [first,second,,,,,,] = foo;

TO

const [first,second,] = foo;

😄

@fisker fisker deleted the no-unreadable-array-destructuring-fix branch January 14, 2021 08:14
@sindresorhus
Copy link
Owner

Yeah, no point in supporting unrealistic cases.

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.

Auto fix for no-unreadable-array-destructuring
2 participants