{"name":"@putout/plugin-remove-useless-new","version":"2.0.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":"16b16c58666ae3984b28993bde894456f503ac6b","bugs":{"url":"https://github.com/coderaiser/putout/issues"},"_id":"@putout/plugin-remove-useless-new@2.0.0","_nodeVersion":"18.0.0","_npmVersion":"8.3.0","dist":{"integrity":"sha512-TdQoLw1Lq4E7ajbx8qmRKRmaWoP9bVI+Bg8OQPb/wuLCqLBgOGnzeLV6RJsvIHxBvMEjBKQzDbgCbtqhc2RACw==","shasum":"ac6e27c29e9dc8f0fb009c61d57eee2dec5a6f2f","tarball":"http://registry-npm.ywwl.com/@putout/plugin-remove-useless-new/download/@putout/plugin-remove-useless-new-2.0.0.tgz","fileCount":4,"unpackedSize":4523,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFlV8EO6xQDqdtNgjhw45NSqabsaiN3jK9TndJlazE31AiAYE88kSiTjUmUd8V/iGZL6zjBgn/8N5cMLbIVMLq+W7Q=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJibEI7ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrk7g/8C7kZ/jHpXLe2yHF89nVPPKnfSKXjVJ3CP82ww86b2fALiq2j\r\nNBV5BGhsN6/xVZtoeaLRzT1X3XtbrLfnOZWpow4hLWM2oZ04TQmmomcp5PqI\r\nnWMF474vGkADPY5OWbqk908l1ztB28NiB+vIk0syjcEJLShQd2SeRp9HFEpg\r\ndexUwCtFPDPRtCnFvVyuJXsq8tUFIhSwaSdkaY5qKRUtHz44Fz/A+q8zmjPn\r\nwM15KPbcC5yDouB9EY+V2dj7x4eVjujLR67OmraAuyyueLWRSrXXP0tP8swk\r\nKI8vsvEFSdzrolonVgxIUfkFBU0oRfcARcxBhm9CCqVTptN9TIXJQP1g8wgC\r\nv20OCgwOk/dJ6cNjFIC2g7FD5oouRgGuFYg1WMdpRt9GdawukYRMwv7B2YkX\r\nABqp5LpeceJ2G5Sb7T9FgimQKxe2Nkyp1nnU7UjxWHr7ggV17vc5hkDc6r7q\r\n6ZJC/AZzYcdJr8fbkN41m9gB75UDls0ty5Y+PoVN9TkHSJhbaPY1xM4dWgFb\r\nwVEsZgbFPwHoEHH8mB0OJOq8j/0UoIplzt7iSDJAeL3cNmOi5pNkFKNnROTb\r\nvLs9inqUwohbSUo3YGP/qod7zIxA5d9UjNvboafvbp99waqTb8Mb3jCg+YV6\r\nFX2EIt6z4nFDPp2Ri0XQQHE/F1sc+q9HJ8M=\r\n=FDuq\r\n-----END PGP SIGNATURE-----\r\n","size":2185,"noattachment":false,"key":"/@putout/plugin-remove-useless-new/-/@putout/plugin-remove-useless-new-2.0.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.0.0_1651262010930_0.7502884084068944"},"_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":1651262011117,"_cnpm_publish_time":1651262011117,"dist-tags":{"latest":"2.3.2"}}