{"name":"@putout/plugin-remove-useless-type-conversion","version":"3.0.1","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/v28.19.2/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":"^6.0.0","c8":"^7.5.0","eslint":"^8.0.1","eslint-plugin-n":"^15.2.4","eslint-plugin-putout":"^16.0.0","madrun":"^9.0.0"},"peerDependencies":{"putout":">=28"},"license":"MIT","engines":{"node":">=16"},"publishConfig":{"access":"public"},"gitHead":"8770054c91b2d50d5de97916495c7950debb4d26","bugs":{"url":"https://github.com/coderaiser/putout/issues"},"_id":"@putout/plugin-remove-useless-type-conversion@3.0.1","_nodeVersion":"18.14.2","_npmVersion":"9.1.3","dist":{"integrity":"sha512-C1U0g6xPpdxlqButp1ID7XDh+suTmJC6yMMkh6V1q6Rp+p0nSvdHpROxI0OaxN5/psjUawG6Y2A7ic2pzL1xvQ==","shasum":"40f18fbb62b5946d8e588a8f56026904f0096217","tarball":"http://registry-npm.ywwl.com/@putout/plugin-remove-useless-type-conversion/download/@putout/plugin-remove-useless-type-conversion-3.0.1.tgz","fileCount":6,"unpackedSize":5672,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDQxOX5lvyI4G9fytyMVdxirp9wPNMbakZ5zuDKgipgzgIhAJtYNfwOh9knSJZvMZsSmrlduHmV+E3vRYqPxVBDVn3d"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkCzmcACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpnYQ/9Fqmy7Unyphfx0jyjAErBfNEgLdIpfBwP7WGqLd/nqqu4I+qa\r\noT1C+uXtHyKGVj3ZRdDV8oJeRk2TKqShWYE1znq3aFsweRVY+K8bRceUdmu5\r\n7p8X1qugzzpryTB7G6reTpkum3GgvSDGhOvOzNwktAu5nghkkrKwdCLoxb+3\r\n/v6PRSPFlBpoayulSlHznAXq7Oqpufb6Agn+bJnwkZhI/toElsM0xCIl20H+\r\nlLMh4lG8Mh1F1AnwN+ZnAHxvIhclKmHcLXF+umuC9x70fgukdp8JUlgvQKL5\r\nAfQkz8wBPRtx166MaQEU1BveDa0wzOlOodYLLgzZKIG1R1/DiT46XdupUdcH\r\npwqukiPa2thMJejMAdb/0NVmQmTb1pHNMOTqRI1BmSiWE6t1l6CMaN42X2ly\r\nZe6Hy+EeIEvr3kPaxTDSUna6IF5RC21bmOUiVhh2Q2A7Qg9yMY7y4YTgA0Ly\r\nMxhlEn5ufAat7kpHLguWHGkU7KRLNybRCJZjqnonSI1tAtaPcLjEvS/5RvwP\r\nGaGFuzmHaYfDy02PkZ2hFffT7tId+X3KkYINNyd40NpDMUy5IAXaOtMJjasb\r\nmjOarQvBpU6PmpXusqsmglVjMb5KHsNY+l34f6zkBCAG5v2KPxzr66RQZiTg\r\nyL46/4T+u7AI+J3j5ctS9nfNo6JNDhCByoQ=\r\n=CpNN\r\n-----END PGP SIGNATURE-----\r\n","size":2525,"noattachment":false,"key":"/@putout/plugin-remove-useless-type-conversion/-/@putout/plugin-remove-useless-type-conversion-3.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-type-conversion_3.0.1_1678457243939_0.4797333849481962"},"_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":1678457244096,"_cnpm_publish_time":1678457244096,"dist-tags":{"latest":"3.0.1"}}