{"name":"@putout/plugin-remove-nested-blocks","version":"7.0.0","keywords":["putout","putout-plugin","plugin","remove","nested","blocks"],"author":{"url":"https://github.com/coderaiser","name":"coderaiser","email":"mnemonic.enemy@gmail.com"},"license":"MIT","_id":"@putout/plugin-remove-nested-blocks@7.0.0","homepage":"https://github.com/coderaiser/putout/tree/master/packages/plugin-remove-nested-blocks#readme","bugs":{"url":"https://github.com/coderaiser/putout/issues"},"tag":false,"dist":{"shasum":"4819f481a1e2f84a2048a80473cbd3cb18f6e285","tarball":"http://registry-npm.ywwl.com/@putout/plugin-remove-nested-blocks/download/@putout/plugin-remove-nested-blocks-7.0.0.tgz","fileCount":4,"integrity":"sha512-MnBr8FlY/gBc5VWb8oZm38KO3lxhubJJKpii4h+MH9+knqEp9sBBEc7qpJU8sNrmtoX03vdM261ntob7CZgt6A==","signatures":[{"sig":"MEUCID/UXv4nZBZdKTqxJmECXui4om7Z2R8GPWyCcvzvuObZAiEAkExGv/lByIwfMsRfWJ+HZJgDefrkBL2Nt6BjFd1A6VQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":5560,"size":2551,"noattachment":false,"key":"/@putout/plugin-remove-nested-blocks/-/@putout/plugin-remove-nested-blocks-7.0.0.tgz"},"main":"lib/remove-nested-blocks.js","type":"commonjs","engines":{"node":">=18"},"gitHead":"3eb2f1e4fb567acf69e0c74eccc56f8a243586ba","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 ability to find and remove nested blocks","directories":{},"_nodeVersion":"22.13.0","dependencies":{},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"c8":"^10.0.0","lerna":"^6.0.1","eslint":"^9.0.0","madrun":"^10.0.0","montag":"^1.2.1","nodemon":"^3.0.1","supertape":"^10.0.0","@putout/test":"^11.0.0","eslint-plugin-n":"^17.0.0","@putout/plugin-tape":"*","eslint-plugin-putout":"^23.0.0","@putout/plugin-for-of":"*"},"peerDependencies":{"putout":">=37"},"_npmOperationalInternal":{"tmp":"tmp/plugin-remove-nested-blocks_7.0.0_1736871353413_0.5259032259408714","host":"s3://npm-registry-packages-npm-production"},"readme":"# @putout/plugin-remove-nested-blocks [![NPM version][NPMIMGURL]][NPMURL]\n\n[NPMIMGURL]: https://img.shields.io/npm/v/@putout/plugin-remove-nested-blocks.svg?style=flat&longCache=true\n[NPMURL]: https://npmjs.org/package/@putout/plugin-remove-nested-blocks \"npm\"\n\n> Delimited by a pair of curly brackets **block statement** is used to group zero or more statements.\n>\n> (c) [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/block)\n\n🐊[**Putout**](https://github.com/coderaiser/putout) plugin adds ability to find and remove **nested bocks**.\n\n☝️*Remember, when you [writing a transform](https://github.com/coderaiser/putout/tree/master/packages/engine-runner#readme) you can skip all parts related to **removing nested blocks** and just reuse current **plugin** it will make your code simpler and less error prone.*\n\n## Install\n\n```\nnpm i @putout/plugin-remove-nested-blocks\n```\n\n## Rule\n\n```json\n{\n    \"rules\": {\n        \"remove-nested-blocks\": \"on\"\n    }\n}\n```\n\n## ❌ Example of incorrect code\n\n```js\nfor (const x of Object.keys(a)) {\n    {\n        console.log(x);\n        console.log(xxx);\n    }\n}\n```\n\n## ✅ Example of correct code\n\n```js\nfor (const x of Object.keys(a)) {\n    console.log(x);\n    console.log(xxx);\n}\n\nswitch(x) {\ncase 1: {\n    const m = 5;\n}\n}\n```\n\n## Comparison\n\nLinter | Rule | Fix\n--------|-------|------------|\n🐊 **Putout**| [`remove-nested-blocks`](https://github.com/coderaiser/putout/tree/master/packages/plugin-remove-nested-blocks#readme)| ✅\n⏣ **ESLint** | [`no-lone-blocks`](https://eslint.org/docs/rules/no-lone-blocks) | ❌\n\n## License\n\nMIT\n","publish_time":1736871353610,"maintainers":[{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"}],"_cnpm_publish_time":1736871353610,"dist-tags":{"latest":"9.1.0"}}