{"name":"@putout/plugin-apply-early-return","version":"3.0.1","type":"commonjs","author":{"name":"coderaiser","email":"mnemonic.enemy@gmail.com","url":"https://github.com/coderaiser"},"description":"🐊Putout plugin adds ability use apply early return","homepage":"https://github.com/coderaiser/putout/tree/master/packages/plugin-apply-early-return#readme","main":"lib/apply-early-return.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-apply","plugin","early-return"],"devDependencies":{"@putout/test":"^11.0.0","c8":"^10.0.0","eslint":"^9.0.0","eslint-plugin-n":"^17.0.0","eslint-plugin-putout":"^23.0.0","lerna":"^6.0.1","madrun":"^10.0.0","nodemon":"^3.0.1"},"peerDependencies":{"putout":">=29"},"license":"MIT","engines":{"node":">=16"},"publishConfig":{"access":"public"},"_id":"@putout/plugin-apply-early-return@3.0.1","gitHead":"0a04e7bdba57b1cda825c9e230312b33964f7fc7","bugs":{"url":"https://github.com/coderaiser/putout/issues"},"_nodeVersion":"22.13.1","_npmVersion":"10.9.0","dist":{"integrity":"sha512-p+0J3qdUEctqHGMJu1bORuEx6YUwPwNMfs5Wky/KIx7t7EEjPMU+iddFdh0Wc7Vii6nJ8jONnQgpVvFnlKcP/g==","shasum":"d11f2c6b9e60779ffb1558245849185cc45ea5a3","tarball":"http://registry-npm.ywwl.com/@putout/plugin-apply-early-return/download/@putout/plugin-apply-early-return-3.0.1.tgz","fileCount":4,"unpackedSize":4360,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCbI56XICvBN1z8PqgT4Q6+zGQUcOeJHojvOh8iDfFfXgIgXRzkDPpi3knNcGhbgIIF4cEWWY/sM9Iw1bIe6S5NZa0="}],"size":2122,"noattachment":false,"key":"/@putout/plugin-apply-early-return/-/@putout/plugin-apply-early-return-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-npm-production","tmp":"tmp/plugin-apply-early-return_3.0.1_1738163400795_0.31405087061667114"},"_hasShrinkwrap":false,"readme":"# @putout/plugin-apply-early-return [![NPM version][NPMIMGURL]][NPMURL]\n\n[NPMIMGURL]: https://img.shields.io/npm/v/@putout/plugin-apply-early-return.svg?style=flat&longCache=true\n[NPMURL]: https://npmjs.org/package/@putout/plugin-apply-early-return\"npm\"\n\n> In short, an **early return** provides functionality so the result of a conditional statement can be returned as soon as a result is available, rather than wait until the rest of the function is run. Merged with [`@putout/plugin-return`](https://www.npmjs.com/package/@putout/plugin-return).\n>\n> (c) [dev.to](https://dev.to/jenniferlynparsons/early-returns-in-javascript-5hfb)\n\n🐊[**Putout**](https://github.com/coderaiser/putout) plugin adds ability to apply **early return**.\n\n## Install\n\n```\nnpm i @putout/plugin-apply-early-return\n```\n\n## Rule\n\n```json\n{\n    \"rules\": {\n        \"apply-early-return\": \"on\"\n    }\n}\n```\n\n## ❌ Example of incorrect code\n\n```js\nfunction get(a) {\n    let b = 0;\n    \n    if (a > 0)\n        b = 5;\n    else\n        b = 7;\n    \n    return b;\n}\n```\n\n## ✅ Example of correct code\n\n```js\nfunction get(a) {\n    if (a > 0)\n        return 5;\n    \n    return 7;\n}\n```\n\n## License\n\nMIT\n","publish_time":1738163400989,"_cnpm_publish_time":1738163400989,"dist-tags":{"latest":"3.0.1"}}