$ npm install @putout/plugin-split-nested-destructuring
- Don't use nested destructuring on data that comes from any external data sources (such as
REST API
s,GraphQL
endpoints or files).- Don't use nested destructuring on function arguments that have long or complicated signatures.
🐊Putout plugin adds ability to split nested destructuring.
npm i @putout/plugin-split-nested-destructuring -D
{
"rules": {
"split-nested-destructuring": "on"
}
}
const {
a: {
b,
},
a: {
b: x,
},
} = c;
function f({a: {b}}) {
console.log(b);
}
const {a} = c;
const {b, b: x} = a;
function f({a}) {
const {b} = a;
console.log(b);
}
MIT
© 2010 - cnpmjs.org x YWFE | Home | YWFE