Skip to content

prefer-destructuring rule triggers when mutating let binding #1705

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

Closed
abonander opened this issue Jan 23, 2018 · 2 comments
Closed

prefer-destructuring rule triggers when mutating let binding #1705

abonander opened this issue Jan 23, 2018 · 2 comments

Comments

@abonander
Copy link

When you have the following:

let foo;
// ...
foo = bar.foo;

The prefer-destructuring rule triggers on the last line even though there's no way to actually mutate a let binding with destructuring ({ foo } = bar; is a syntax error).

@ljharb
Copy link
Collaborator

ljharb commented Jan 23, 2018

({ foo } = bar);

@abonander
Copy link
Author

That works, but looks worse than the original IMO. Still, not a problem with the rule itself, so closing.

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

No branches or pull requests

2 participants