react/destructuring-assignment oneliner
See original GitHub issueSimple and clean oneliner:
handleClick = () => this.props.firebase.logout();
Right now, I have to write
handleClick = () => {
const {firebase} = this.props;
firebase.logout();
};
This destructuration is useless in this case. Please remove warnings for oneliner methods where no params are given to the method.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:3
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Destructuring and clone object / One line? - Stack Overflow
I'm using react.js , and I want to obtain from the state an array, but I required to clone it and save it...
Read more >Destructuring assignment - JavaScript - MDN Web Docs
In this example, f() returns the values [1, 2] as its output, which can be parsed in a single line with destructuring. function...
Read more >Using destructuring assignment in React - Nathan Sebhastian
Destructuring assignment is a feature of JavaScript introduced by ES6 (or ES 2015) ... You just turned two lines of assignment into one....
Read more >eslint-plugin-react/destructuring-assignment.md at master
Enforce consistent usage of destructuring assignment of props, state, and context ( react/destructuring-assignment ). This rule is automatically fixable ...
Read more >Destructuring assignment - The Modern JavaScript Tutorial
Objects allow us to create a single entity that stores data items by key. ... Destructuring assignment is a special syntax that allows...
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
it is, then. Looking forward to the rule, please share it in this issue if you don’t forget about it by then, thanks 😃
@jeffvandyke sure. With class fields, you can also do: