{"name":"@putout/plugin-apply-destructuring","version":"9.0.0","keywords":["putout","putout-plugin","plugin","destructuring"],"author":{"url":"https://github.com/coderaiser","name":"coderaiser","email":"mnemonic.enemy@gmail.com"},"license":"MIT","_id":"@putout/plugin-apply-destructuring@9.0.0","maintainers":[{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"}],"homepage":"https://github.com/coderaiser/putout/tree/master/packages/plugin-apply-destructuring#readme","bugs":{"url":"https://github.com/coderaiser/putout/issues"},"tag":false,"dist":{"shasum":"0d10973c70c9b9c04ac80f46e6df62893be3656a","tarball":"http://registry-npm.ywwl.com/@putout/plugin-apply-destructuring/download/@putout/plugin-apply-destructuring-9.0.0.tgz","fileCount":7,"integrity":"sha512-w+VnxMJ7lm44+PDB4x4ATmaITXJXakiJiEY22HezfAYmbythgUWlXLc1l319R4W1xdrxZYJCcmnRdyVkxGjJ1A==","signatures":[{"sig":"MEUCIQC+y8IDd03UxENvQh4/MhmkD0zJ1QhZH1MKzVXhqIUO8gIgXVKhOtFBfOJjemrPX4pZ4q2mtxiiZQo21ceeJQdLAsc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":5820,"size":2671,"noattachment":false,"key":"/@putout/plugin-apply-destructuring/-/@putout/plugin-apply-destructuring-9.0.0.tgz"},"main":"lib/index.js","type":"module","engines":{"node":">=20"},"gitHead":"606227d4bfe1f95107473c4b8e831644e0f1087e","release":false,"scripts":{"lint":"madrun lint","test":"madrun test","report":"madrun report","coverage":"madrun coverage","fix:lint":"madrun fix:lint","fresh:lint":"madrun fresh:lint","lint:fresh":"madrun lint:fresh","watch:test":"madrun watch:test"},"_npmUser":{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"},"changelog":false,"repository":{"url":"git+https://github.com/coderaiser/putout.git","type":"git"},"_npmVersion":"11.1.0","description":"🐊Putout plugin adds ability use destructuring on variable declarations","directories":{},"_nodeVersion":"20.19.0","dependencies":{},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"c8":"^10.0.0","eslint":"^9.0.0","madrun":"^11.0.0","nodemon":"^3.0.1","@putout/test":"^13.0.0","eslint-plugin-n":"^17.0.0","eslint-plugin-putout":"^26.0.0"},"peerDependencies":{"putout":">=39"},"_npmOperationalInternal":{"tmp":"tmp/plugin-apply-destructuring_9.0.0_1743776970406_0.10891045654508602","host":"s3://npm-registry-packages-npm-production"},"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. Renamed to [`@putout/plugin-destructuring`](https://www.npmjs.com/package/@putout/plugin-destructuring).\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- ✅ [convert-object-to-array](#convert-object-to-array);\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## convert-object-to-array\n\nCheck out in 🐊[**Putout Editor**](https://putout.cloudcmd.io/#/gist/a1d26daf8bb83ee3ea1c0b62a6ad3afd/cef9b4d27c9dbb0d413a935b0359a6fe9b50364f).\n\n## ❌ Example of incorrect code\n\n```js\nconst {0: a, 1: b} = c;\n```\n\n## ✅ Example of correct code\n\n```js\nconst [a, b] = c;\n```\n\n## License\n\nMIT\n","publish_time":1743776970580,"_cnpm_publish_time":1743776970580,"dist-tags":{"latest":"10.1.1"}}