@putout/plugin-split-nested-destructuring
🐊Putout plugin adds ability to split nested destructuring
Last updated a year ago by coderaiser .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install @putout/plugin-split-nested-destructuring 
SYNC missed versions from official npm registry.

@putout/plugin-split-nested-destructuring NPM version

  • Don't use nested destructuring on data that comes from any external data sources (such as REST APIs, GraphQL endpoints or files).
  • Don't use nested destructuring on function arguments that have long or complicated signatures.

(c) Destructuring in JavaScript: the not so good parts

🐊Putout plugin adds ability to split nested destructuring.

Install

npm i @putout/plugin-split-nested-destructuring -D

Rule

{
    "rules": {
        "split-nested-destructuring": "on"
    }
}

❌ Example of incorrect code

const {
    a: {
        b,
    },
    a: {
        b: x,
    },
} = c;

function f({a: {b}}) {
    console.log(b);
}

✅ Example of correct code

const {a} = c;
const {b, b: x} = a;

function f({a}) {
    const {b} = a;
    console.log(b);
}

License

MIT

Current Tags

  • 3.0.0                                ...           latest (a year ago)

8 Versions

  • 3.0.0                                ...           a year ago
  • 2.2.1                                ...           2 years ago
  • 2.2.0                                ...           2 years ago
  • 2.1.0                                ...           2 years ago
  • 2.0.0                                ...           2 years ago
  • 1.1.0                                ...           4 years ago
  • 1.0.1                                ...           5 years ago
  • 1.0.0                                ...           5 years ago
Maintainers (1)
Downloads
Total 0
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (8)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE