{"name":"@putout/plugin-remove-useless-new","version":"1.0.1","author":{"name":"coderaiser","email":"mnemonic.enemy@gmail.com","url":"https://github.com/coderaiser"},"description":"putout plugin adds ability to remove useless `new` operator","homepage":"http://github.com/coderaiser/putout","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":"^3.0.0","c8":"^7.5.0","eslint":"^8.0.0-beta.2","eslint-plugin-node":"^11.0.0","madrun":"^8.0.1"},"peerDependencies":{"putout":">=20"},"license":"MIT","engines":{"node":">=14"},"publishConfig":{"access":"public"},"bugs":{"url":"https://github.com/coderaiser/putout/issues"},"_id":"@putout/plugin-remove-useless-new@1.0.1","_nodeVersion":"16.9.1","_npmVersion":"7.12.0","dist":{"integrity":"sha512-t+kzW20p0xt8k0+Iq/tkD9z1ABnevzf2pUaN68qjb/1AFnctyqADqcOUOxvow3W/H5vltCH2kKNJCH+qkT3D3Q==","shasum":"20e0a53ba133cdcf1be0fece0077c30b583f5b83","tarball":"http://registry-npm.ywwl.com/@putout/plugin-remove-useless-new/download/@putout/plugin-remove-useless-new-1.0.1.tgz","fileCount":4,"unpackedSize":4003,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh2XmxCRA9TVsSAnZWagAAw9wQAJshofqK41bStSwC3+J5\nFlu0KHOil4jFd4EAV8lbcsysPC7hySPeOdSfKUzKKoihPliX2oW1E0xRE9AF\n5JoC8P9+2vleCaIiVZyvJVbeNUwPQyZB6BkUTiYPUCH0CpsP+YMfFnZPhmWa\nD4J+OLsTThqxss1lizSnWvYGco7IGP2jPwMbf88qUWi413A9iAHQHeneQLaR\njjVMFYCB8KRKvYQJCHPs0RJfDEwn8c/Fp3nrauiUSsdVRIgkBYl0e7yZqT0A\nROtYhpQZPhSVo2wT2ZUeZHLYSPEQD6SPbdtqqPLuLNPVA4HRTtP2OmP22/po\n+iqIendyc2S2q32yH/dY6uRDh81aFdm5gPOioMHwldWlFzAk5tyKSRPw+l6U\nSAjfcuTQH7EPnP303OrJbESxGcD7iM+Mn4MMzp6TYyNy05jvirWps1btY4hF\nEBoF92tuHoYoBH/wPNY3ni06yH+SBouubgU2DvrJvyqylICJQajkcrdy1PfD\n3mcxPTDbkbp/kG7/9Hb+CbUMDZYBGqDm2biIyncBdxAHnhylLJJiRJ8jpT2C\nXkiPsxLqrBnMaMaAW5ALRr93BGAc8BpMCjYFfn5YFKWMIz00+2J9Lin1Y5dv\nIxS16JNvLFu1I5kIkod6fRx5WG7ieBlK0UiAj/KYxjstW0xmRIta9oZtD72l\nO4YQ\r\n=IOGH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC/Jt3n8v1RjmKJt8qwBpOCvq9HwDsUKqtK8cxY741AiAiA38D12ch1rLptfrbFx5Vt+cwcVsanA1ECABB1Jnok7tQ=="}],"size":2005,"noattachment":false,"key":"/@putout/plugin-remove-useless-new/-/@putout/plugin-remove-useless-new-1.0.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_1.0.1_1632329892698_0.0974620504915571"},"_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":1632329892890,"_cnpm_publish_time":1632329892890,"dist-tags":{"latest":"2.3.2"}}