-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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: Suggestion fixer for prefer-destructuring
#18460
Comments
the plugin is not maintained by eslint team. please file it in https://github.com/typescript-eslint/typescript-eslint. |
@typescript-eslint/prefer-destructuring
prefer-destructuring
@aladdin-add I did mean |
this example is a bit confusing, while |
although it's confusing code (IMO), the suggestion in the issue does appear to work as described. Object destructuring with computed keys evidently works just fine on an array; the indices are just properties. |
What rule do you want to change?
prefer-destructuring
What change do you want to make?
Implement suggestions
How do you think the change should be implemented?
A new default behavior
Example code
What does the rule currently do for this code?
Warn but doesn't offer fixes
What will the rule do after it's changed?
Offer a suggestion to manually fix:
Participation
Additional comments
My original use-case was actually for
@typescript-eslint/prefer-destructuring
. If I understand correctly, if this is added for ESLint, typescript-eslint should follow with their support.From:
To:
The parenthesis requirement make the
enforceForRenamedProperties
option hard for me to enable as I feel like other team members will also get confused as to why the syntax is incorrect until realizing that parenthesis are required w/o assignement keywords.The text was updated successfully, but these errors were encountered: