{"name":"@putout/plugin-convert-break-to-return","version":"1.0.1","keywords":["putout","putout-plugin","plugin","convert","break","return"],"author":{"url":"https://github.com/coderaiser","name":"coderaiser","email":"mnemonic.enemy@gmail.com"},"license":"MIT","_id":"@putout/plugin-convert-break-to-return@1.0.1","maintainers":[{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"}],"homepage":"https://github.com/coderaiser/putout/tree/master/packages/plugin-convert-break-to-return#readme","bugs":{"url":"https://github.com/coderaiser/putout/issues"},"tag":false,"dist":{"shasum":"e1de6f47d5ade0f38fd3979bb36a01a3682ab00e","tarball":"http://registry-npm.ywwl.com/@putout/plugin-convert-break-to-return/download/@putout/plugin-convert-break-to-return-1.0.1.tgz","fileCount":4,"integrity":"sha512-xGNuvpiC5VGbTV08ehS/bjWvr5A73OnYsy5RFx0rsbrwxaBL2hKSjT0mMq7N4dbohLjLWLjcStYX8fHcFDo0aQ==","signatures":[{"sig":"MEQCIAya+adbl4Za2TlXk3fga5RtHYYk4IjIvllNGxRngYW8AiBopx0SkR2E8N8W7pOd9gqa2ZjSRqjxXGpQUKKyXAm4dg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":4713,"size":2229,"noattachment":false,"key":"/@putout/plugin-convert-break-to-return/-/@putout/plugin-convert-break-to-return-1.0.1.tgz"},"main":"lib/convert-break-to-return.js","type":"commonjs","engines":{"node":">=18"},"gitHead":"5de88012e47f8460f81355e246fb7b60bcbef4c8","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 convert 'break' to 'return'","directories":{},"_nodeVersion":"22.13.1","dependencies":{},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"c8":"^10.0.0","eslint":"^9.0.0","madrun":"^10.0.0","@putout/test":"^11.0.0","eslint-plugin-n":"^17.0.0","eslint-plugin-putout":"^23.0.0"},"peerDependencies":{"putout":">=37"},"_npmOperationalInternal":{"tmp":"tmp/plugin-convert-break-to-return_1.0.1_1738152887029_0.5894788172735126","host":"s3://npm-registry-packages-npm-production"},"readme":"# @putout/plugin-convert-break-to-return [![NPM version][NPMIMGURL]][NPMURL]\n\n[NPMIMGURL]: https://img.shields.io/npm/v/@putout/plugin-convert-break-to-return.svg?style=flat&longCache=true\n[NPMURL]: https://npmjs.org/package/@putout/plugin-convert-break-to-return \"npm\"\n\n> The `break` statement terminates the current loop or switch statement and transfers program control to the statement following the terminated statement.\n>\n> (c) [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_syntax)\n\n> `SyntaxError: unlabeled break must be inside loop or switch`\n>\n> (c) [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Bad_break)\n\n🐊[**Putout**](https://github.com/coderaiser/putout) plugin adds ability to convert `break` to `return`. Checkout in 🐊[**Putout Editor**](https://putout.cloudcmd.io/#/gist/a321ee4d76a066c17835b4aa50f91499/10646f7383b8d58cda02417485d5281955da95be). Merged with [`@putout/plugin-return`](https://www.npmjs.com/package/@putout/plugin-return).\n\n## Install\n\n```\nnpm i @putout/plugin-convert-break-to-return -D\n```\n\n## Rule\n\n```json\n{\n    \"rules\": {\n        \"convert-break-to-return\": \"on\"\n    }\n}\n```\n\n## ❌ Example of incorrect code\n\n```ts\nfunction x() {\n    if (a)\n        break;\n    \n    return false;\n}\n```\n\n## ✅ Example of correct code\n\n```js\nfunction x() {\n    if (a)\n        return;\n    \n    return false;\n}\n```\n\n## License\n\nMIT\n","publish_time":1738152887210,"_cnpm_publish_time":1738152887210,"dist-tags":{"latest":"1.0.5"}}