{"name":"@putout/plugin-remove-useless-type-conversion","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 type conversion","homepage":"https://github.com/coderaiser/putout/tree/master/packages/plugin-remove-useless-type-conversion#readme","main":"lib/index.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","putout-plugin-remove","plugin","type-conversion","useless"],"devDependencies":{"@putout/test":"^5.0.0","c8":"^7.5.0","eslint":"^8.0.1","eslint-plugin-node":"^11.0.0","eslint-plugin-putout":"^14.0.0","madrun":"^9.0.0"},"peerDependencies":{"putout":">=25"},"license":"MIT","engines":{"node":">=16"},"publishConfig":{"access":"public"},"gitHead":"3571e3072ce651910113791984c4ebd059469ecd","bugs":{"url":"https://github.com/coderaiser/putout/issues"},"_id":"@putout/plugin-remove-useless-type-conversion@2.0.0","_nodeVersion":"16.14.2","_npmVersion":"8.3.0","dist":{"integrity":"sha512-wPglZa7HwMShlD1J3ZnI5Z/HIPyeskvz+3o6/Gu2HpfFKND2m79YPvg2Hnvcb2j6Ylfat0g95CqX06dKRavF5Q==","shasum":"de488e5334baeb7e6d9204cc32ee017b31e517bb","tarball":"http://registry-npm.ywwl.com/@putout/plugin-remove-useless-type-conversion/download/@putout/plugin-remove-useless-type-conversion-2.0.0.tgz","fileCount":6,"unpackedSize":5169,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiOgCCACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrIzhAAiSLhbP/a3wF2r8hEKcCeqtGUehVLYT/ivlfSnsv7J4dpa1cW\r\nkHk/nYG1OWba9qxLyKQEiTkw9RF5NTSqa67eu2TwC24/PNi7tHkbRKp7vLTh\r\n3HKmvUCa6UMFhTEfd/t/alY6EBzlktncAJzG5DCiV3teWaXC6AIC2ZEkwYFO\r\nKZ7yqWLvRlvjP8GUCdApb92/cGOTSGYuvzafEt9PrmXsvRJR/ApZ4iENmHKE\r\ng0SDpITLuPUoEVWyWwdRb1r+ud0FwCLnzVIq1UU7WrpOqASPkBGSa+CHvVdf\r\nQbHwqktOaAVM3AvTfgsotAH9AwHT3ikd2n9wk7Pml5oMlEPluut4JIeuhCeG\r\ngvYMqsyNB/CWEWC4tEiiAz8HZQZELs7sE71VdQClPLsM8OtPglOw64aff8Qx\r\nCZD/A4k3uSWT2J28EMXhyVD/8dk0XYzxoz2puX4GXSwRBrjS0pGqP/3R3Rx7\r\nP7itJ9DF6PCdPLJnRKDzmB4AnBgC+jZrKroE0lX+Qim0xzNOeSQI3cqcPODf\r\n5PphRvjTL0Boqi0scG8Pjf4ITXRESDBzDINthkY4W0xLLRm8FGXippQpGo0H\r\nRVvzOzfJRFDD5bXBYWcpWbScZMKwIGdKnWqGEANS4Xo9DdKcd57YsdCjRTHq\r\noDRFB4ZaFyWWpinx8ip9Efoeu7MI2v7PZm4=\r\n=4dev\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICSUXntFS6uA4VPYnmOp+VigvkyygohF/Fbqu0HpGUELAiA7Hi1dm4rVxTHNDFISYDU9PCfCYt9JCkWB448o+4QdQQ=="}],"size":2337,"noattachment":false,"key":"/@putout/plugin-remove-useless-type-conversion/-/@putout/plugin-remove-useless-type-conversion-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-type-conversion_2.0.0_1647968386554_0.29245156500479896"},"_hasShrinkwrap":false,"readme":"# @putout/plugin-remove-useless-type-conversion [![NPM version][NPMIMGURL]][NPMURL]\n\n[NPMIMGURL]: https://img.shields.io/npm/v/@putout/plugin-remove-useless-type-conversion.svg?style=flat&longCache=true\n[NPMURL]: https://npmjs.org/package/@putout/plugin-remove-useless-type-conversion \"npm\"\n\n> It is possible to use a couple of **NOT** operators (`!!`) in series to explicitly force the conversion of any value to the corresponding boolean primitive. The conversion is based on the \"truthyness\" or \"falsyness\" of the value.\n>\n> The same conversion can be done through the `Boolean` function.\n>\n> (c) [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Logical_NOT)\n\n🐊[**Putout**](https://github.com/coderaiser/putout) plugin adds ability to remove useless type conversion. Merged to [`@putout/plugin-types`](https://www.npmjs.com/package/@putout/plugin-types).\n\n## Install\n\n```\nnpm i @putout/plugin-remove-useless-type-conversion\n```\n\n## Rule\n\n```json\n{\n    \"rules\": {\n        \"remove-useless-type-conversion/named\": \"on\",\n        \"remove-useless-type-conversion/with-double-negations\": \"on\"\n    }\n}\n```\n\n## named\n\n### ❌ Example of incorrect code\n\n```js\nconst a = !![1].includes(1);\nconst b = Boolean([1].includes(1));\n```\n\n### ✅ Example of correct code\n\n```js\nconst a = [1].includes(1);\n```\n\n## with-double-negations\n\n### ❌ Example of incorrect code\n\n```js\nif (!!a) {\n    console.log('hi');\n}\n```\n\n### ✅ Example of correct code\n\n```js\nif (a) {\n    console.log('hi');\n}\n```\n\n## Comparison\n\nLinter | Rule | Fix\n--------|-------|------------|\n🐊 **Putout** | [`remove-useless-type-conversion`](https://github.com/coderaiser/putout/tree/master/packages/plugin-remove-useless-type-conversion#readme)| ✅\n⏣ **ESLint** | [`no-implicit-coercion`](https://eslint.org/docs/rules/no-implicit-coercion) | ✅\n\n## License\n\nMIT\n","publish_time":1647968386704,"_cnpm_publish_time":1647968386704,"dist-tags":{"latest":"3.0.1"}}