Make prefer-destructuring fixable
See original GitHub issueWhat rule do you want to change? prefer-destructuring
Does this change cause the rule to produce more or fewer warnings? same
Please provide some example code that this change will affect:
// This
const z = a.z
// should autofix to this
const { z } = a
Are you willing to submit a pull request to implement this change? no
Issue Analytics
- State:
- Created 5 years ago
- Reactions:6
- Comments:7 (5 by maintainers)
Top Results From Across the Web
prefer-destructuring - ESLint - Pluggable JavaScript Linter
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
Read more >How to fix Eslint error "prefer-destructuring"? - Stack Overflow
It's an ES6 feature used to unpack variables from arrays or objects. this syntax create an array from variables: var x = [y,...
Read more >prefer-destructuring - Rules - ESLint - GitHub Pages
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
Read more >JavaScript : How to fix Eslint error "prefer-destructuring"?
JavaScript : How to fix Eslint error " prefer - destructuring "? [ Gift : Animated Search Engine : https://bit.ly/AnimSearch ] JavaScript :...
Read more >Use Object Destructuring.Eslint(Prefer-Destructuring) - ADocLib
Prefer destructuring from arrays and objects preferdestructuring. The fix option on the command line can automatically fix some of the problems reported by...
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 Free
Top 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
I would be happy if it only auto-fixed the simple case, like
let x = a.x;
=>let {x} = a;
.I think supporting auto-fixing for the most basic cases is fine for this rule.