{"name":"@putout/plugin-remove-useless-new","version":"2.2.0","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":"c2c6fb62237a3a3a86a71b206bee550aa0267c08","bugs":{"url":"https://github.com/coderaiser/putout/issues"},"_id":"@putout/plugin-remove-useless-new@2.2.0","_nodeVersion":"16.14.2","_npmVersion":"8.3.0","dist":{"integrity":"sha512-IQ0hi6zr92Kh3VDMSgA25LAgBjs4XqLAo7IV+ZrOQbihfyjMvrjT3cP+44MjDHH4RTjMOpe5rJJuca5hbfk9pQ==","shasum":"e06d49fa12da91bac81b99c1fe339366323fe6d5","tarball":"http://registry-npm.ywwl.com/@putout/plugin-remove-useless-new/download/@putout/plugin-remove-useless-new-2.2.0.tgz","fileCount":4,"unpackedSize":4548,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAaFxx/bS6OeYGZ3h0RwDKhukKiEtCq7s9ycLETr98wgAiEAxreT75W5Dm32T9qwZ4piR4+elx1nqotMJa20MUK2DvQ="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJids6VACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrXKA//ZsNciWVB3jwjvmiSutEyHEV42hXNWRTTLgwRw4hpFxUh6n8f\r\nmAOMJBkIJRQQRErYa/0jNPMX288XNlyAwbEG7zMB44yb09GBXCenwfdz8N59\r\ncOoOT8NT8PVaurLaQdL3cSWrZ4Y85swKTIqJXFISbD00adnpyrANedhMvmsD\r\njIzdb6r2BTKSDfKEd5wYbdIuwMEXQBeWRVk4aa6QdO9JFl9UtJF2jqWzTFqb\r\nFENdIyP69Ry6tMRAwtKDTf5WPsx5eWNMVpUHB10QdhMzKuSJOjaZoLx6s3E7\r\nbEeBXX9EiEBQzzBl3s1SAcTkD3y1TB2gTJCc1BhnlwsX9lQ7o1EepzXogn+b\r\nLv5myyR+URV1o7V7US2TfuuROzTSeaqU6fRhfgdVKhAQxcRQXvkpdxMh0yaT\r\ngiCdwdRNkbk4uiYIJrMe6BZFzwzZaHN0GU28JUoPpSZcNAebHJokiumkdDF2\r\nWWJTC3wCs3GNwDIVu/t3f/lg4BYA7IOIh0W/TjEHsYC4ioMKWO6Sd0K3jRBM\r\nHDhBhPbHHiZAha6bNpG5WHMQdkbGAOUi/8Kzs3aG+iwNS9c9Qj+SCPCD5Kea\r\n79Br0gapLwrsU3wOiA6JpHpoZyCJUOdVZP7Kon/iQcRLBaFR7Keemjy5+Nh1\r\ngxA5Eq4zcuraBkC69vs940ywHBLnpCQuMTg=\r\n=5oky\r\n-----END PGP SIGNATURE-----\r\n","size":2209,"noattachment":false,"key":"/@putout/plugin-remove-useless-new/-/@putout/plugin-remove-useless-new-2.2.0.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.2.0_1651953301213_0.6571805759106921"},"_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":1651953301400,"_cnpm_publish_time":1651953301400,"dist-tags":{"latest":"2.3.2"}}