{"name":"@putout/plugin-parens","version":"6.0.1","type":"module","author":{"name":"coderaiser","email":"mnemonic.enemy@gmail.com","url":"https://github.com/coderaiser"},"description":"🐊Putout plugin adds missing and remove useless parens","homepage":"https://github.com/coderaiser/putout/tree/master/packages/plugin-parens#readme","main":"lib/index.js","release":false,"tag":false,"changelog":false,"repository":{"type":"git","url":"git+https://github.com/coderaiser/putout.git"},"scripts":{"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-add","parens","plugin"],"devDependencies":{"@putout/eslint-flat":"^4.0.0","@putout/test":"^15.0.0","eslint":"^10.0.0","eslint-plugin-putout":"^31.0.0","madrun":"^13.0.0","nodemon":"^3.0.1","superc8":"^12.0.0"},"peerDependencies":{"putout":">=42"},"license":"MIT","engines":{"node":">=22"},"publishConfig":{"access":"public"},"_id":"@putout/plugin-parens@6.0.1","gitHead":"a04d420098cb2b97d8f51e9ed57e417379bef254","bugs":{"url":"https://github.com/coderaiser/putout/issues"},"_nodeVersion":"26.3.1","_npmVersion":"11.4.2","dist":{"integrity":"sha512-ajhv4Z/zbE5njNdu0fsbxa0qag7bqvgsUPKwzFX+QcsgIUvVeO/3qEzOxy8OEMnzor+E2DjHQI7ICDdAFRwMXQ==","shasum":"0d0e8ac756d68751339cc908abbf7c30141cf735","tarball":"http://registry-npm.ywwl.com/@putout/plugin-parens/download/@putout/plugin-parens-6.0.1.tgz","fileCount":10,"unpackedSize":12274,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCON8ulrLkBts1JNj5zJ6KKL3N2V9VOuxVunEb6ztM6fgIgdbSKj+bZoaQceCOW14P5pTrgGldDxzYKY3gQO928WiE="}],"size":3966,"noattachment":false,"key":"/@putout/plugin-parens/-/@putout/plugin-parens-6.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-npm-production","tmp":"tmp/plugin-parens_6.0.1_1782429955434_0.13162147203427388"},"_hasShrinkwrap":false,"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## Rules\n\n- ✅ [add-missing-from-await](#add-missing-from-await);\n- ✅ [add-missing-for-template](#add-missing-for-template);\n- ✅ [add-missing-for-assign](#add-missing-for-assign);\n- ✅ [remove-useless-from-await](#remove-useless-from-params);\n- ✅ [remove-useless-from-params](#remove-useless-from-params);\n- ✅ [remove-useless-from-object](#remove-useless-from-object);\n\n## Config\n\nShort:\n\n```json\n{\n    \"rules\": {\n        \"parens/add-missing\": \"on\",\n        \"parens/remove-useless\": \"on\"\n    }\n}\n```\n\nFull:\n\n```json\n{\n    \"rules\": {\n        \"parens/add-missing-from-await\": \"on\",\n        \"parens/add-missing-for-template\": \"on\",\n        \"parens/add-missing-for-assign\": \"on\",\n        \"parens/remove-useless-from-await\": \"on\",\n        \"parens/remove-useless-from-params\": \"on\",\n        \"parens/remove-useless-from-object\": \"on\"\n    }\n}\n```\n\n## add-missing-for-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## add-missing-from-await\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## add-missing-for-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\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```\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-from-await\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## remove-useless-from-params\n\n> `Uncaught SyntaxError: Invalid destructuring assignment target`\n>\n> (c) Chrome\n\nCheckout in 🐊[**Putout Editor**](https://putout.cloudcmd.io/#/gist/8cbc3929366a2e6e5f9db64b461f5a2f/568ec40e8f4f0b0195dc44a078fa1a9ae62abe2b).\n\n### ❌ Example of incorrect code\n\n```\nconst a = ((b)) => c;\n```\n\n### ✅ Example of correct code\n\n```js\nconst a = (b) => c;\n```\n\n## remove-useless-from-object\n\nCheckout in 🐊[**Putout Editor**](https://putout.cloudcmd.io/#/gist/3800b0c52a199dd49a089ed4b9b37566/16cee4a82af4e6add03b8c26e20923ac0e66cec3).\n\n### ❌ Example of incorrect code\n\n```ts\ncreateNestedDirectory(({}) as any);\n```\n\n### ✅ Example of correct code\n\n```ts\ncreateNestedDirectory({} as any);\n```\n\n## License\n\nMIT\n","publish_time":1782429955588,"_cnpm_publish_time":1782429955588,"dist-tags":{"latest":"6.0.1"}}