{"name":"@putout/plugin-remove-useless-variables","version":"14.2.0","keywords":["putout","putout-plugin","putout-plugin-remove","plugin","remove","useless","variables","for-of"],"author":{"url":"https://github.com/coderaiser","name":"coderaiser","email":"mnemonic.enemy@gmail.com"},"license":"MIT","_id":"@putout/plugin-remove-useless-variables@14.2.0","maintainers":[{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"}],"homepage":"https://github.com/coderaiser/putout/tree/master/packages/plugin-remove-useless-variables#readme","bugs":{"url":"https://github.com/coderaiser/putout/issues"},"tag":false,"dist":{"shasum":"5a3761f98c846804913cf834581777263e434988","tarball":"http://registry-npm.ywwl.com/@putout/plugin-remove-useless-variables/download/@putout/plugin-remove-useless-variables-14.2.0.tgz","fileCount":10,"integrity":"sha512-ChOhU7SSFsfgya0N59FbGAiZ5URfs7ybDDYj5CS9DB04edKK3foboq9adlUYG4PvuXdIGoIg4ccWMTUHvfUOfQ==","signatures":[{"sig":"MEUCIQD6HFitFKGCC6v2sP29FLlz9jkPPtX6frQG/kfGVyyN6gIgCR2y5m/K5KcAkT5o/0Y5ZyB5qQyoT4EoNIUQIkUlgNs=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":15832,"size":4545,"noattachment":false,"key":"/@putout/plugin-remove-useless-variables/-/@putout/plugin-remove-useless-variables-14.2.0.tgz"},"main":"lib/index.js","type":"module","engines":{"node":">=20"},"gitHead":"e7db2bcbd60b696a887e1d975f58e87303a26c5d","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.4.2","description":"🐊Putout plugin adds ability to find and remove useless","directories":{},"_nodeVersion":"25.2.1","dependencies":{},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"c8":"^10.0.0","eslint":"v10.0.0-alpha.0","madrun":"^11.0.0","nodemon":"^3.0.1","@putout/test":"^14.0.0","eslint-plugin-n":"^17.0.0","@putout/eslint-flat":"^3.0.0","@putout/plugin-maybe":"*","eslint-plugin-putout":"^28.0.0","@putout/plugin-declare":"*","@putout/plugin-reuse-duplicate-init":"*","@putout/plugin-remove-useless-array-from":"*"},"peerDependencies":{"putout":">=40"},"_npmOperationalInternal":{"tmp":"tmp/plugin-remove-useless-variables_14.2.0_1764327685007_0.6282475749509324","host":"s3://npm-registry-packages-npm-production"},"readme":"# @putout/plugin-remove-useless-variables [![NPM version][NPMIMGURL]][NPMURL]\n\n[NPMIMGURL]: https://img.shields.io/npm/v/@putout/plugin-remove-useless-variables.svg?style=flat&longCache=true\n[NPMURL]: https://npmjs.org/package/@putout/plugin-remove-useless-variables \"npm\"\n\n🐊[**Putout**](https://github.com/coderaiser/putout) plugin adds ability to find and remove `useless variables`. Renamed to [`@putout/plugin-variables`](https://www.npmjs.com/package/@putout/plugin-variables).\n\n## Install\n\n```\nnpm i @putout/plugin-remove-useless-variables -D\n```\n\n## Rules\n\n- ✅ [assignment](#assignmentn);\n- ✅ [declaration](#declaration);\n- ✅ [destruct](#destruct);\n- ✅ [duplicate](#duplicate);\n- ✅ [remove](#remove);\n- ✅ [rename](#rename);\n\n## Config\n\n```json\n{\n    \"rules\": {\n        \"remove-useless-variables/assignment\": \"on\",\n        \"remove-useless-variables/rename\": \"on\",\n        \"remove-useless-variables/remove\": \"on\",\n        \"remove-useless-variables/destruct\": \"on\",\n        \"remove-useless-variables/declaration\": [\"on\", {\n            \"maxLength\": 20\n        }],\n        \"remove-useless-variables/duplicate\": \"on\"\n    }\n}\n```\n\n## assignment\n\nCheckout in 🐊[**Putout Editor**](https://putout.cloudcmd.io/#/gist/a2f7fe5e2c294443576f95dce6fde67e/0699ccb4f7335e8e3f80de891913a8e3ad4f35e3).\n\n### ❌ Example of incorrect code\n\n```js\nwhile (!(files = readDirectory(parentDir)).length) {}\n```\n\n### ✅ Example of correct code\n\n```js\nwhile (!readDirectory(parentDir).length) {}\n```\n\n## rename\n\n### ❌ Example of incorrect code\n\n```js\nfunction hi(a) {\n    const b = a;\n}\n```\n\n### ✅ Example of correct code\n\n```js\nfunction hi(b) {}\n```\n\n## destruct\n\n### ❌ Example of incorrect code\n\n```js\nfunction hi(c) {\n    const {a, b} = c;\n}\n```\n\n### ✅ Example of correct code\n\n```js\nfunction hi({a, b}) {}\n```\n\n## remove\n\n### ❌ Example of incorrect code\n\n```js\nconst child_process = require('node:child_process');\n\nconst {exec, spawn} = child_process;\n```\n\n### ✅ Example of correct code\n\n```js\nconst {exec, spawn} = require('node:child_process');\n```\n\n### remove\n\nCheck it out in 🐊[**Putout Editor**](https://putout.cloudcmd.io/#/gist/041767876a6d41c82260b293a06c2b6b/addf2b49cf9235d9b7a1017065cec5dece232660).\n\n### ❌ Example of incorrect code\n\n```js\nconst a = 5;\nconst b = a;\n\nconst c = 5;\n\nd = c;\n```\n\n### ✅ Example of correct code\n\n```js\nconst b = 5;\n\nd = 5;\n```\n\n### declaration\n\nCheck it out in 🐊[**Putout Editor**](https://putout.cloudcmd.io/#/gist/32177535829956ef4c7b51587a8853c3/1fe071ff6542dc66ffad55f4776733903ab07241).\n\n### ❌ Example of incorrect code\n\n```js\nfunction x() {\n    const a = 5;\n    return a;\n}\n\nconst z = b.c.replace('x', 'y');\n\nb.c = z;\n```\n\n### ✅ Example of correct code\n\n```js\nfunction x() {\n    return 5;\n}\n\nb.c = b.c.replace('x', 'y');\n```\n\n### duplicate\n\nCheck it out in 🐊[**Putout Editor**](https://putout.cloudcmd.io/#/gist/32177535829956ef4c7b51587a8853c3/52f19ab0e467ad7cc54fa8c554c3b0804de9d1ca).\n\n### ❌ Example of incorrect code\n\n```js\nconst DestructuringErrors = function DestructuringErrors(a, b) {\n    return [a, b];\n};\n```\n\n### ✅ Example of correct code\n\n```js\nfunction DestructuringErrors(a, b) {\n    return [a, b];\n}\n\nbc = b.c.replace('x', 'y');\n```\n\n## License\n\nMIT\n","publish_time":1764327685195,"_cnpm_publish_time":1764327685195,"dist-tags":{"latest":"14.2.1"}}