Skip to content

Latest commit

 

History

History

plugin-merge-destructuring-properties

@putout/plugin-merge-destructuring-properties NPM version

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 merge destructuring properties.

Install

npm i @putout/plugin-merge-destructuring-properties

Rule

Rule merge-destructuring-properties is enabled by default, to disable add to .putout.json:

{
    "rules": {
        "merge-destructuring-properties": "off"
    }
}

❌ Example of incorrect code

const {one} = require('numbers');
const {two} = require('numbers');

✅ Example of correct code

const {one, two} = require('numbers');

License

MIT