7.1.0 β’ Published 11 months ago
@putout/plugin-apply-destructuring v7.1.0
@putout/plugin-apply-destructuring
The destructuring assignment syntax is a JavaScript expression that makes it possible to unpack values from arrays, or properties from objects, into distinct variables.
(c) MDN
πPutout plugin adds ability to use destructuring on variable declarations.
Install
npm i @putout/plugin-apply-destructuring
Rule
{
"rules": {
"apply-destructuring/object": "on",
"apply-destructuring/array": "on",
"apply-destructuring/falsy": "on"
}
}
array
β Example of incorrect code
const first = array[0];
β Example of correct code
const [first] = array;
object
β Example of incorrect code
const name = user.name;
β Example of correct code
const {name} = user;
falsy
Check out in πPutout Editor.
β Example of incorrect code
const {maxElementsInOneLine} = {
options,
};
β Example of correct code
const {maxElementsInOneLine} = options;
License
MIT
7.0.0
12 months ago
7.1.0
11 months ago
6.1.0
1 year ago
6.0.0
1 year ago
5.3.0
2 years ago
5.2.1
3 years ago
5.2.0
3 years ago
5.1.1
3 years ago
5.1.0
3 years ago
5.0.0
4 years ago
4.0.0
5 years ago
3.1.0
5 years ago
3.0.0
5 years ago
2.4.0
5 years ago
2.3.0
5 years ago
2.2.1
5 years ago
2.2.0
5 years ago
2.1.0
5 years ago
2.0.0
5 years ago
1.1.0
5 years ago
1.0.1
5 years ago
1.0.0
5 years ago