🐊Putout plugin adds ability to remove useless 'push()'
npm install @putout/plugin-remove-useless-push[NPMIMGURL]: https://img.shields.io/npm/v/@putout/plugin-remove-useless-push.svg?style=flat&longCache=true
[NPMURL]: https://npmjs.org/package/@putout/plugin-remove-useless-push "npm"
> The push() method of Array instances adds the specified elements to the end of an array and returns the new length of the array.
>
> (c) MDN
🐊Putout plugin adds ability to remove useless push(). The rule fits good with putout/remove-unused-variables.
Checkout in 🐊Putout Editor.
```
npm i @putout/plugin-remove-useless-push
`json`
{
"rules": {
"remove-useless-push": "on"
}
}
`js`
function get() {
const a = [];
const b = [];
a.push(1);
b.push(2);
return b;
}
`js``
function get() {
const a = [];
const b = [];
b.push(2);
return b;
}
MIT