{"name":"@putout/plugin-remove-useless-new","version":"2.3.2","type":"commonjs","author":{"name":"coderaiser","email":"mnemonic.enemy@gmail.com","url":"https://github.com/coderaiser"},"description":"🐊Putout plugin adds ability to remove useless operator 'new'","homepage":"https://github.com/coderaiser/putout/tree/v25.18.0/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":"6a996941069b5112887775776a568a1b641c9cdb","bugs":{"url":"https://github.com/coderaiser/putout/issues"},"_id":"@putout/plugin-remove-useless-new@2.3.2","_nodeVersion":"18.0.0","_npmVersion":"8.3.0","dist":{"integrity":"sha512-SkWQrKsClYkIoXZOQHDWidRYB9xG3Oz0ZZMOur7TQKxJqjmYAEk0k6+Qd2o5NFOsRUgSHGcmuL25YDvSyTbekg==","shasum":"90726ec50d37a486ac02dd80f7a2018c7e80bd3c","tarball":"http://registry-npm.ywwl.com/@putout/plugin-remove-useless-new/download/@putout/plugin-remove-useless-new-2.3.2.tgz","fileCount":4,"unpackedSize":4792,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHSeTl723oQ7ox4nzlEh0sCPlekAoJ9P4qOuwFcsOkAlAiA0d1rm+HFq9RmwQRFiMNab25s0xHOJFURVDavDaeD6SA=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJid4ReACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmov3w//YW75ZtRQ3AaL9vSCdUN4VWR+pnpWYkJa8nskI240ov99RenQ\r\nmCbMHXTOUAU4I2DgZASCRTcwrfqPke9yEHtYIbqO5+UlW97be8B25BhwHWyC\r\nIPmplb/3SE0bNUe4rSAF492NF2wg9oPgTN5S+4h+JCFt2lUlkyV1qHqgcIdk\r\neBI4IgLlvRExJ0yJbMyzYa6nSl2X4kkjpx4LPhEYcGNap2xdjFmFSYZ4Y0rG\r\nTDAzABD81NBTcWFU6H+8AZo04gx8Tqx8mf/XX1GiaQY+btB3ElN4Eh+6b/rA\r\nPE9GvjKcj9X8RQeLSrozBjpz7IioG/Saaue3Klbq24iS7mdeW8OHKflVE/Bp\r\n6qhrT8s2lFD2PRvXCb6hITmWnI9Yk44mjB3qKy9PgcDR6AMSh67pRwF+dlpT\r\nb1NGFqorxQ7SR+bjEX/ucFX1Aldw9ldtvVALWn7W+nAzWMVr6BPbq5/c7/NL\r\nlZ7/owDpUVf5jwIqUB3XrttuCtKNPvvF5Xk/n95VTXA/Mx01Hr1fILTXNX3v\r\nADPuyu6jEE0Tz5vUBnnuXSwOsnmP78qm2VsxZvlvNbk5uYJs8nK/xORUYG2I\r\nOxM+HszvVlCLT/GX0h84V276PgRlDmJu0W130S5H6+j6YI9km1G00qiztt98\r\nSskFgF5iguMdEbIxtxpYhFAMUGmWGQsVDCA=\r\n=LL1U\r\n-----END PGP SIGNATURE-----\r\n","size":2273,"noattachment":false,"key":"/@putout/plugin-remove-useless-new/-/@putout/plugin-remove-useless-new-2.3.2.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.3.2_1651999837919_0.6292914681561661"},"_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":1651999838086,"_cnpm_publish_time":1651999838086,"dist-tags":{"latest":"2.3.2"}}