{"name":"@putout/plugin-remove-useless-new","version":"2.1.1","type":"commonjs","author":{"name":"coderaiser","email":"mnemonic.enemy@gmail.com","url":"https://github.com/coderaiser"},"description":"putout plugin adds ability to remove useless `new` operator","homepage":"https://github.com/coderaiser/putout/tree/master/packages/plugin-remove-useless-new#readme","main":"lib/remove-useless-new.js","release":false,"tag":false,"changelog":false,"repository":{"type":"git","url":"git://github.com/coderaiser/putout.git"},"scripts":{"publishOnly":"madrun publishOnly","test":"madrun test","watch:test":"madrun watch:test","lint":"madrun lint","fresh:lint":"madrun fresh:lint","lint:fresh":"madrun lint:fresh","fix:lint":"madrun fix:lint","coverage":"madrun coverage","report":"madrun report"},"dependencies":{},"keywords":["putout","putout-plugin","plugin","new","useless"],"devDependencies":{"@putout/test":"^5.0.0","c8":"^7.5.0","eslint":"^8.0.1","eslint-plugin-node":"^11.0.0","madrun":"^9.0.0"},"peerDependencies":{"putout":">=25"},"license":"MIT","engines":{"node":">=16"},"publishConfig":{"access":"public"},"gitHead":"2497583e5a552db41a5178b1713fce5d156c5793","bugs":{"url":"https://github.com/coderaiser/putout/issues"},"_id":"@putout/plugin-remove-useless-new@2.1.1","_nodeVersion":"16.14.2","_npmVersion":"8.3.0","dist":{"integrity":"sha512-CL2oelDDo1diF25YyAQ6TTTYV5Ep4vmJJKnUJ774p12QzKIymmfzXTh7OyBY8uc/IdMy5l+XxOikZyJWjI/TXA==","shasum":"918e78b9ec820ee5062b8b6b0b76376f0973020f","tarball":"http://registry-npm.ywwl.com/@putout/plugin-remove-useless-new/download/@putout/plugin-remove-useless-new-2.1.1.tgz","fileCount":4,"unpackedSize":4702,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCvTSX/QrXC6q8Kr7sXoyVTyycrVWKamJ1FJOaV/Sz8gAIgVnSaiiFl5/JTVLQV4o1RW5K+MayMUpJXuMJRfIpAuNM="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJibEWUACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmor9BAApDaDxQCEdBEJMUni9r74iK61ysPPPztIAqNhw2bjayh+hdHG\r\nkns95UcNNFA4v5z0MCx/0t4dTApE5C236mkWecSxxIhEezWkkbykQXBhiZXf\r\nHqaSDlmYM3moDtGyS6lU3e/oV1Uej3+ukfKnRsVVoJYmf/Gk3eqWuY/LirVH\r\nTndW+CoUnoSSwsZ/Eu3kfu054oEfLnn9wLjzy6+1zLUHoa+nq+EvkgD1m/6V\r\nmwTie3sfbMlrk9qnVD7yT0ne+IhwOyO6ZDPbe1TuUOLSkl2zdBBSxol4eedc\r\nn5YtjQX9kUhAunJNHjkh42QYCF0ZZpo1SmIea20VPlsJLdJD+62gFrKCmqmL\r\nQ44k5wDQpSj8BQFzAP/bncG4hIJoPlKLWGhrnILnHEXZpsPcBafGXVcrxQGm\r\nIpF9WOB/emN3hf1/C5mkHDwg4bVLEiwia/asqezSNCzWZIuaW9wm9hHOmjHo\r\nI0dmFddyd8ZlZp3u6anVCf2UTuhZ/nM7lCDaxVokql0sfhAOsq+8pyu1EEFI\r\n9pC5tRF0romSlbeoY4lPidmWbdZN3huNmEDvkPu946PSBC9v8L/QDuARd9QY\r\nVDOnA+FOiJLvCaJHkG+CVcbFHPdUySIkdahggkF1r9ixA8E+ZuGg9iFWF0GS\r\nOqgw4EaPtdGIpHec17lF41L2VQh6mWfi67M=\r\n=azUY\r\n-----END PGP SIGNATURE-----\r\n","size":2239,"noattachment":false,"key":"/@putout/plugin-remove-useless-new/-/@putout/plugin-remove-useless-new-2.1.1.tgz"},"_npmUser":{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"},"directories":{},"maintainers":[{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/plugin-remove-useless-new_2.1.1_1651262868721_0.20382380542780765"},"_hasShrinkwrap":false,"readme":"# @putout/plugin-remove-useless-new [![NPM version][NPMIMGURL]][NPMURL]\n\n[NPMIMGURL]: https://img.shields.io/npm/v/@putout/plugin-remove-useless-new.svg?style=flat&longCache=true\n[NPMURL]: https://npmjs.org/package/@putout/plugin-remove-useless-new \"npm\"\n\n🐊[**Putout**](https://github.com/coderaiser/putout) plugin adds ability to remove useless operator `new`. Which has no sense for `BigInt`, `Boolean`, `String`, `Number`, `Object`, `RegExp`, `Error`:\n\n> Thus the function call `Error(…)` is equivalent to the object creation expression `new Error(…)` with the same arguments.\n>\n> (c) https://262.ecma-international.org/12.0/#sec-error-constructor\n\nAnd [`Symbol`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol) cannot be used with `new`, as it is primitive.\nPart of [`@putout/plugin-new`](https://www.npmjs.com/package/@putout/plugin-new).\n\n## Install\n\n```\nnpm i @putout/plugin-remove-useless-new\n```\n\n## Rule\n\n```json\n{\n    \"rules\": {\n        \"remove-useless-new\": \"on\"\n    }\n}\n```\n\n## ❌ Example of incorrect code\n\n```js\nnew Error('Something whent wrong');\nnew new Boolean();\n```\n\n## ✅ Example of correct code\n\n```js\nError('Something whent wrong');\nBoolean();\n```\n\n## Comparison\n\nLinter | Rule | Fix\n--------|-------|------------|\n🐊 **Putout** | [`remove-useless-new`](https://github.com/coderaiser/putout/tree/master/packages/plugin-remove-useless-new#readme)| ✅\n🦕 **ESLint** | [`no-new-wrappers`](https://eslint.org/docs/rules/no-new-wrappers) | ❌\n⠀| [`no-new-object`](https://eslint.org/docs/rules/no-new-object) | ❌\n⠀| [`no-array-constructor`](https://eslint.org/docs/rules/no-array-constructor) | ❌\n⠀| [`no-new-symbol`](https://eslint.org/docs/rules/no-new-symbol) | ❌\n\n## License\n\nMIT\n","publish_time":1651262868871,"_cnpm_publish_time":1651262868871,"dist-tags":{"latest":"2.3.2"}}