-
-
Notifications
You must be signed in to change notification settings - Fork 369
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 proposal: prefer-destructured-variables
#1230
Comments
This looks like a good solution for your use case and a good compromise solution for those of us who do want to require destructuring where possible and practical, but not tyrannically so (as long as it is implemented to meet my case as it sounds it would be and GuoSirius' (since that is technically a variable but just not yet available)). In any case, some false negatives are not concealing technically bad code. |
I agree, I thought |
This is now accepted. |
Writing the obvious, but the rule should check if foo.a was assigned to a new value and not warn if that's the case |
I understand we already have
consistent-destructuring
, and it already covers cases I'm going to post, but that rule is buggy, and I don't like destructuring all used properties in one, I prefer destructuring when needed, for example:Fail
Pass
It's like splitting
consistent-destructuring
into two rules, this one and another likeprefer-one-destructuring
.consistent-destructuring
propsalThe text was updated successfully, but these errors were encountered: