{"name":"@putout/plugin-remove-useless-new","version":"2.1.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":"b3e95cda6be21f35d29dc2887c00b77065e3a89f","bugs":{"url":"https://github.com/coderaiser/putout/issues"},"_id":"@putout/plugin-remove-useless-new@2.1.0","_nodeVersion":"16.14.2","_npmVersion":"8.3.0","dist":{"integrity":"sha512-EDKZ/k0JQJH4jHrOifeJO9mNI2Q2jBKewAeN06DM0vlh7pGkU9wYe2UAqKaBdwwUPL+wDJmM8yiCkudX743tRQ==","shasum":"ca4f823d29b990d721226fff8775763b1cd3ceae","tarball":"http://registry-npm.ywwl.com/@putout/plugin-remove-useless-new/download/@putout/plugin-remove-useless-new-2.1.0.tgz","fileCount":4,"unpackedSize":4724,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDqhp3Xdw6Z2+K/ld+AHm1G6N+LZSdwjq2EP5QziSVb/AiEAugZR1uBuKRVnrRxEYChqz5mZObrp6R7nsD4qOq+dAj0="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJibEP8ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoanQ//YZxrTVpKdgiAmk5NowQpx8F1KAlSwbhpZExzGmZcclxfQ9L5\r\nfbNI1t3Xx/WJX/pB5jPsnaWRP5RXuQfJTbsGPrOmodfR/wrhubvWweSuYZno\r\n3w+/Ij2SWr41PLNWeynKSEvL7rs5Go+CzFO1E5lW/8KoRhfc3p7G4TNf77Tf\r\njY32fvUpaz5r8Rmui0CyjUA+xortAYPV3FZyZQoaxw4iabg9S02waRcVCVTZ\r\nBFQGAfdTnjLL4uIEjbTIymhXYITdKKDQpSsyqm1AIvN4x5NQ+dfJ7gZDNGGT\r\nh4A+9MnQqPHnJ1uiwEO7jrrg0L4At2uHmcBHqi4tORXYIc089rvRIIS6+zbq\r\nnSBYDBMge2L9bWFj8dKWWahMsNqE1YJAsAzvNoO7+YcMD6FVlT0w3iE/Vtrc\r\n3/LsqJ/qi77b/t8laAFCeNRxjNAe8V7xZNzsvG4X+2v8Rs2GEH3dtvwwcHqR\r\n0JBDJ6cxw0ZhEUzbZ8PkwkMkqo1FEIk8uo1Lg+Y4ybasUvnBHQioLpCQ1vn5\r\nP/VmwAArdYuUN9/XD3HxF/OPmUTy7PPimmcIfrDzbQBazWUMpEhp2AUbjzS/\r\n5zaNrQFMeKSMBDZE0/tXyeLt6b03pfF+GTrl/sth8E74rJ3Lli754ejgT3SZ\r\na1lUu1JlIU5aWOJ6y29IgcJ5LKTUMgY+wr8=\r\n=ULMh\r\n-----END PGP SIGNATURE-----\r\n","size":2238,"noattachment":false,"key":"/@putout/plugin-remove-useless-new/-/@putout/plugin-remove-useless-new-2.1.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.1.0_1651262460056_0.949131391534092"},"_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":1651262460220,"_cnpm_publish_time":1651262460220,"dist-tags":{"latest":"2.3.2"}}