@putout/plugin-apply-early-return
v3.0.1
Published
šPutout plugin adds ability use apply early return
Maintainers
Readme
@putout/plugin-apply-early-return 
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.(c) dev.to
šPutout plugin adds ability to apply early return.
Install
npm i @putout/plugin-apply-early-returnRule
{
"rules": {
"apply-early-return": "on"
}
}ā Example of incorrect code
function get(a) {
let b = 0;
if (a > 0)
b = 5;
else
b = 7;
return b;
}ā Example of correct code
function get(a) {
if (a > 0)
return 5;
return 7;
}License
MIT
