{"name":"@putout/plugin-apply-destructuring","version":"8.0.1","type":"commonjs","author":{"name":"coderaiser","email":"mnemonic.enemy@gmail.com","url":"https://github.com/coderaiser"},"description":"🐊Putout plugin adds ability use destructuring on variable declarations","homepage":"https://github.com/coderaiser/putout/tree/master/packages/plugin-apply-destructuring#readme","main":"lib/index.js","release":false,"tag":false,"changelog":false,"repository":{"type":"git","url":"git+https://github.com/coderaiser/putout.git"},"scripts":{"test":"madrun test","watch:test":"madrun watch:test","lint":"madrun lint","fresh:lint":"madrun fresh:lint","lint:fresh":"madrun lint:fresh","fix:lint":"madrun fix:lint","coverage":"madrun coverage","report":"madrun report"},"dependencies":{},"keywords":["putout","putout-plugin","plugin","destructuring"],"devDependencies":{"@putout/eslint-flat":"^2.0.0","@putout/test":"^12.0.0","c8":"^10.0.0","eslint":"^9.0.0","eslint-plugin-n":"^17.0.0","eslint-plugin-putout":"^25.0.1","madrun":"^10.0.0","nodemon":"^3.0.1"},"peerDependencies":{"putout":">=38"},"license":"MIT","engines":{"node":">=18"},"publishConfig":{"access":"public"},"_id":"@putout/plugin-apply-destructuring@8.0.1","gitHead":"f6942cee03c752fe2193251193f5011e6cfd3a1a","bugs":{"url":"https://github.com/coderaiser/putout/issues"},"_nodeVersion":"22.14.0","_npmVersion":"11.1.0","dist":{"integrity":"sha512-yxiEyL0sXLQpiNscr65LeIsLQzaIaCUZ95DNnjXBWFGujJFH+VZUmXY9LgPPU9lppZzrQkiFjmlplaEW7SFSFQ==","shasum":"ba7cf63cfa04333ce05ca58bce1d933655168e6e","tarball":"http://registry-npm.ywwl.com/@putout/plugin-apply-destructuring/download/@putout/plugin-apply-destructuring-8.0.1.tgz","fileCount":7,"unpackedSize":5916,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIHcnOvRhmYxttPCbvR27Sm3yPvckCdajdrLXwiKKAVJfAiEAwr/8TFQSQ/jjRbC4LFS/zTdwe6CKCHnd/qoAKQ1peHY="}],"size":2685,"noattachment":false,"key":"/@putout/plugin-apply-destructuring/-/@putout/plugin-apply-destructuring-8.0.1.tgz"},"_npmUser":{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/plugin-apply-destructuring_8.0.1_1740695475241_0.7020503350904888"},"_hasShrinkwrap":false,"readme":"# @putout/plugin-apply-destructuring [![NPM version][NPMIMGURL]][NPMURL]\n\n[NPMIMGURL]: https://img.shields.io/npm/v/@putout/plugin-apply-destructuring.svg?style=flat&longCache=true\n[NPMURL]: https://npmjs.org/package/@putout/plugin-apply-destructuring\"npm\"\n\n> The **destructuring** assignment syntax is a **JavaScript** expression that makes it possible to unpack values from arrays, or properties from objects, into distinct variables.\n>\n> (c) [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment)\n\n🐊[**Putout**](https://github.com/coderaiser/putout) plugin adds ability to use **destructuring** on variable declarations.\n\n## Install\n\n```\nnpm i @putout/plugin-apply-destructuring\n```\n\n## Rules\n\n- ✅ [object](#object);\n- ✅ [array](#array);\n- ✅ [falsy](#falsy);\n\n## Config\n\nShort:\n\n```json\n{\n    \"rules\": {\n        \"apply-destructuring\": \"on\"\n    }\n}\n```\n\nFull:\n\n```json\n{\n    \"rules\": {\n        \"apply-destructuring/object\": \"on\",\n        \"apply-destructuring/array\": \"on\",\n        \"apply-destructuring/falsy\": \"on\"\n    }\n}\n```\n\n## array\n\n## ❌ Example of incorrect code\n\n```js\nconst first = array[0];\n```\n\n## ✅ Example of correct code\n\n```js\nconst [first] = array;\n```\n\n## object\n\n## ❌ Example of incorrect code\n\n```js\nconst name = user.name;\n\nhello = world.hello;\n```\n\n## ✅ Example of correct code\n\n```js\nconst {name} = user;\n\n({hello} = world);\n```\n\n## falsy\n\nCheck out in 🐊[**Putout Editor**](https://putout.cloudcmd.io/#/gist/c9ed04b421d75ae39e58038fa6e14630/4c097e3173990ec7e5ebabbe2cedf8e952092ebf).\n\n## ❌ Example of incorrect code\n\n```js\nconst {maxElementsInOneLine} = {\n    options,\n};\n```\n\n## ✅ Example of correct code\n\n```js\nconst {maxElementsInOneLine} = options;\n```\n\n## License\n\nMIT\n","publish_time":1740695475409,"maintainers":[{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"}],"_cnpm_publish_time":1740695475409,"dist-tags":{"latest":"10.1.1"}}