{"name":"@putout/plugin-remove-useless-variables","version":"12.6.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@12.6.0","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":"2b6b29542185d8fb8d0991391487211ab85b8412","tarball":"http://registry-npm.ywwl.com/@putout/plugin-remove-useless-variables/download/@putout/plugin-remove-useless-variables-12.6.0.tgz","fileCount":9,"integrity":"sha512-rQkR/5Vw7kTq4lGzyF1T1VqY4nRuuYUuDLW9zrntinVqSj8rkoWVy6tRczsPhk6Ah0fdP1UqSY4uu/qQ0j/eGg==","signatures":[{"sig":"MEQCIB5TgIvf1GdYPPNaALzT1iVhWTbkMexv+q0ZizNJ1zYeAiA4OMtQEG4yGgmQqaScVBE6RRZ8clbW00r2VTr7ro9RuA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":14512,"size":4254,"noattachment":false,"key":"/@putout/plugin-remove-useless-variables/-/@putout/plugin-remove-useless-variables-12.6.0.tgz"},"main":"lib/index.js","type":"commonjs","engines":{"node":">=18"},"gitHead":"377e57c308c9989bbc46340aa6aaa034d8098ff6","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":"10.9.0","description":"🐊Putout plugin adds ability to find and remove useless","directories":{},"_nodeVersion":"22.9.0","dependencies":{},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"c8":"^10.0.0","lerna":"^6.0.1","eslint":"^9.0.0","madrun":"^10.0.0","nodemon":"^3.0.1","@putout/test":"^11.0.0","eslint-plugin-n":"^17.0.0","eslint-plugin-putout":"^23.0.0","@putout/plugin-reuse-duplicate-init":"*","@putout/plugin-remove-useless-array-from":"*"},"peerDependencies":{"putout":">=36"},"_npmOperationalInternal":{"tmp":"tmp/plugin-remove-useless-variables_12.6.0_1730022852269_0.4479538367601812","host":"s3://npm-registry-packages"},"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`.\n\n## Install\n\n```\nnpm i @putout/plugin-remove-useless-variables -D\n```\n\n## Rules\n\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/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## 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":1730022852468,"maintainers":[{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"}],"_cnpm_publish_time":1730022852468,"dist-tags":{"latest":"14.2.1"}}