Rule Proposal: prefer-destructuring
See original GitHub issueFrom requireArrayDestructuring and requireObjectDestructuring.
This rule will warn MemberExpression
s as the favor of destructuring assignments.
{
"prefer-destructuring": ["error", {"object": true, "array": true}]
}
JSCS documents seem to say that this doesn’t prefer nested destructuring. How do we address nested destructuring?
Issue Analytics
- State:
- Created 7 years ago
- Comments:27 (22 by maintainers)
Top Results From Across the Web
prefer-destructuring - ESLint - Pluggable JavaScript Linter
This rule enforces usage of destructuring instead of accessing a property through a member expression.
Read more >Rule proposal: prefer-destructured-variables #1230 - GitHub
I understand we already have consistent-destructuring, and it already covers cases I'm going to post, but that rule is buggy, ...
Read more >ESLint: prefer-destructuring - Styleguide JavaScript
Use object destructuring when accessing and using multiple properties of an object. Destructuring avoids the usage of temporary references for those ...
Read more >What to do when ESLint rule "prefer-destructuring" makes no ...
The first example would be solved by const [firstItem] = myList; obj. · I know. · if you find it useful in general...
Read more >Rule proposal: `prefer-destructured-variables` #1230 - Issuehunt
Rule proposal : `prefer-destructured-variables` #1230. fisker posted onGitHub. <!-- Please don't ignore this template -->.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think we can agree on one level for now, just so we have something for users.
All in favor? 👍 from me.
I’m putting the PR together to add the rule I already created as part of the core rules.