{"name":"@putout/plugin-parens","version":"1.0.0","keywords":["putout","putout-plugin","putout-plugin-add","parens","plugin"],"author":{"url":"https://github.com/coderaiser","name":"coderaiser","email":"mnemonic.enemy@gmail.com"},"license":"MIT","_id":"@putout/plugin-parens@1.0.0","homepage":"https://github.com/coderaiser/putout/tree/master/packages/plugin-parens#readme","bugs":{"url":"https://github.com/coderaiser/putout/issues"},"tag":false,"dist":{"shasum":"408718449b9935e7d937a4982fc2608d042eaab5","tarball":"http://registry-npm.ywwl.com/@putout/plugin-parens/download/@putout/plugin-parens-1.0.0.tgz","fileCount":8,"integrity":"sha512-6Ohn1e2U4qDEHRayLcgdC4FmWvSLgWa0FKWWJ8oOqd+TGxiZFp2zpya7Kaqwj2T0AYSkItBeqXGkJwvQ/Ls48A==","signatures":[{"sig":"MEQCIHyTDebSS0g07MoyoUvNo/Ih7MleU82cdBpFA78F2UqhAiBTLW7QdrIwvfOZ/OK3Ww/njj6la9NKcqslPhyCF4tFoA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":9157,"size":3255,"noattachment":false,"key":"/@putout/plugin-parens/-/@putout/plugin-parens-1.0.0.tgz"},"main":"lib/index.js","type":"commonjs","engines":{"node":">=18"},"gitHead":"1abf919c69690561da5472496d61efb2ad57b0f5","release":false,"scripts":{"lint":"madrun lint","test":"madrun test","report":"madrun report","coverage":"madrun coverage","fix:lint":"madrun fix:lint","fresh:lint":"madrun fresh:lint","lint:fresh":"madrun lint:fresh","watch:test":"madrun watch:test"},"_npmUser":{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"},"changelog":false,"repository":{"url":"git+https://github.com/coderaiser/putout.git","type":"git"},"_npmVersion":"10.9.0","description":"🐊Putout plugin adds missing and remove useless parens","directories":{},"_nodeVersion":"22.12.0","dependencies":{},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"c8":"^10.0.0","lerna":"^6.0.1","eslint":"^9.0.0","madrun":"^10.0.0","nodemon":"^3.0.1","@putout/test":"^11.0.0","eslint-plugin-n":"^17.0.0","eslint-plugin-putout":"^23.0.0"},"peerDependencies":{"putout":">=37"},"_npmOperationalInternal":{"tmp":"tmp/plugin-parens_1.0.0_1734900366114_0.5226442135922067","host":"s3://npm-registry-packages-npm-production"},"readme":"# @putout/plugin-parens [![NPM version][NPMIMGURL]][NPMURL]\n\n[NPMIMGURL]: https://img.shields.io/npm/v/@putout/plugin-parens.svg?style=flat&longCache=true\n[NPMURL]: https://npmjs.org/package/@putout/plugin-parens\"npm\"\n\n🐊[**Putout**](https://github.com/coderaiser/putout) plugin adds ability to add missing parens. Check out in 🐊[**Putout Editor**](https://putout.vercel.app/#/gist/a8ab0ffefed3b1e7dd0f43d794ea86f4/5d45fcc2e283b5b2d0b9e155010d1114b9f0a7ee).\n\n## Install\n\n```\nnpm i @putout/plugin-parens\n```\n\n## Rule\n\n```json\n{\n    \"rules\": {\n        \"parens/add-missing\": \"on\",\n        \"parens/remove-useless\": \"on\"\n    }\n}\n```\n\n## add-missing\n\n### assign\n\n> The JavaScript exception \"invalid assignment left-hand side\" occurs when there was an unexpected assignment somewhere. It may be triggered when a single `=` sign was used instead of `==` or `===`.\n>\n> (c) [**MDN**](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Invalid_assignment_left-hand_side)\n\nTo disable use:\n\n```json\n{\n    \"rules\": {\n        \"parens/add-missing-for-assign\": \"off\"\n    }\n}\n```\n\n```diff\n-a && b = a;\n+a && (b = a);\n```\n\n### await\n\nTo disable use:\n\n```json\n{\n    \"rules\": {\n        \"parens/add-missing-for-await\": \"off\"\n    }\n}\n```\n\n#### ❌ Example of incorrect code\n\n```ts\nawait asyncFn().filter(Boolean);\n```\n\n#### ✅ Example of correct code\n\n```js\n(await asyncFn()).filter(Boolean);\n```\n\n#### template\n\n> The JavaScript exception \"tagged template cannot be used with optional chain\" occurs when the tag expression of a tagged template literal is an optional chain, or if there's an optional chain between the tag and the template.\n>\n> (c) [**MDN**](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Bad_optional_template)\n\n\nCheckout in 🐊[**Putout Editor**](https://putout.vercel.app/#/gist/ef3f1e198a8d5ebeb9dd3fd1fef8f305/c6b46a34037f5cb095b5419b748a24b6dc8e2933).\n\n```json\n{\n    \"rules\": {\n        \"parens/add-missing-for-template\": \"off\"\n    }\n}\n```\n\n#### ❌ Example of incorrect code\n\n```ts\ngetConsoleLog?.()``;\nString?.raw``;\nString?.raw!``;\n```\n\n#### ✅ Example of correct code\n\n```ts\n(getConsoleLog?.())``;\n(String?.raw)``;\n(String?.raw)!``;\n```\n\n## remove-useless\n\n### await\n\nTo disable use:\n\n```json\n{\n    \"rules\": {\n        \"parens/remove-useless-for-await\": \"off\"\n    }\n}\n```\n\nCheckout in 🐊[**Putout Editor**](https://putout.cloudcmd.io/#/gist/3800b0c52a199dd49a089ed4b9b37566/e2dddb75cb68811883cae640a22b340b8e1afa73).\n\n#### ❌ Example of incorrect code\n\n```ts\nconst s = (await m());\n```\n\n#### ✅ Example of correct code\n\n```ts\nconst s = await m();\n```\n\n## License\n\nMIT\n","publish_time":1734900366288,"maintainers":[{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"}],"_cnpm_publish_time":1734900366288,"dist-tags":{"latest":"6.0.1"}}