{"name":"@putout/plugin-remove-useless-push","version":"2.0.0","keywords":["putout","putout-plugin","plugin","push","putout-plugin-remove","putout-plugin-remove-useless","remove","useless"],"author":{"url":"https://github.com/coderaiser","name":"coderaiser","email":"mnemonic.enemy@gmail.com"},"license":"MIT","_id":"@putout/plugin-remove-useless-push@2.0.0","maintainers":[{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"}],"homepage":"https://github.com/coderaiser/putout/tree/master/packages/plugin-remove-useless-push#readme","bugs":{"url":"https://github.com/coderaiser/putout/issues"},"tag":false,"dist":{"shasum":"9ea301b15f3d20d5e6bf8d3949a98b30c5328808","tarball":"http://registry-npm.ywwl.com/@putout/plugin-remove-useless-push/download/@putout/plugin-remove-useless-push-2.0.0.tgz","fileCount":4,"integrity":"sha512-FC/hzTaoPdA7ZGjx8dKOJmmFuf0w4dwdnaNffCDe6TFz9w2jTDTmhXo+g8RfBlgqKYDYSM4QjXO8d24vXwMGFA==","signatures":[{"sig":"MEUCIQDDTyjLWg7oTFqHyrRqpdIdVgBlUzVdiLTgIMXs1XXmagIgK5mPfp7tmgh52bAM/iaOiFNP0JMMNBfgT28TgyCcW0Y=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":4667,"size":2227,"noattachment":false,"key":"/@putout/plugin-remove-useless-push/-/@putout/plugin-remove-useless-push-2.0.0.tgz"},"main":"lib/remove-useless-push.js","type":"module","engines":{"node":">=20"},"gitHead":"b7645c98fbfc62801a7baa7f83d0d231c482c7a9","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","publishOnly":"madrun publishOnly"},"_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 to remove useless 'push()'","directories":{},"_nodeVersion":"23.11.0","dependencies":{"eslint-plugin-putout":"^26.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"c8":"^10.0.0","eslint":"^9.0.0","madrun":"^11.0.0","@putout/test":"^13.0.0","eslint-plugin-n":"^17.0.0","@putout/eslint-flat":"^3.0.0"},"peerDependencies":{"putout":">=40"},"_npmOperationalInternal":{"tmp":"tmp/plugin-remove-useless-push_2.0.0_1746903178669_0.8817776163444937","host":"s3://npm-registry-packages-npm-production"},"readme":"# @putout/plugin-remove-useless-push [![NPM version][NPMIMGURL]][NPMURL]\n\n[NPMIMGURL]: https://img.shields.io/npm/v/@putout/plugin-remove-useless-push.svg?style=flat&longCache=true\n[NPMURL]: https://npmjs.org/package/@putout/plugin-remove-useless-push \"npm\"\n\n> The `push()` method of `Array` instances adds the specified elements to the end of an array and returns the new length of the array.\n>\n> (c) [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/push)\n\n🐊[**Putout**](https://github.com/coderaiser/putout) plugin adds ability to remove useless `push()`. The rule fits good with  [`putout/remove-unused-variables`](https://github.com/coderaiser/putout/tree/master/packages/plugin-remove-unused-variables#readme).\n\nCheckout in 🐊[**Putout Editor**](https://putout.cloudcmd.io/#/gist/edebc3873f4b2ea6d99cfb957814bc63/603eed77455010519c1127490267888e3f6576a8).\n\n## Install\n\n```\nnpm i @putout/plugin-remove-useless-push\n```\n\n## Rule\n\n```json\n{\n    \"rules\": {\n        \"remove-useless-push\": \"on\"\n    }\n}\n```\n\n## ❌ Example of incorrect code\n\n```js\nfunction get() {\n    const a = [];\n    const b = [];\n    \n    a.push(1);\n    b.push(2);\n    \n    return b;\n}\n```\n\n## ✅ Example of correct code\n\n```js\nfunction get() {\n    const a = [];\n    const b = [];\n    \n    b.push(2);\n    \n    return b;\n}\n```\n\n## License\n\nMIT\n","publish_time":1746903178862,"_cnpm_publish_time":1746903178862,"dist-tags":{"latest":"3.0.0"}}