$ cnpm install @putout/plugin-convert-break-to-return
The
breakstatement terminates the current loop or switch statement and transfers program control to the statement following the terminated statement.(c) MDN
SyntaxError: unlabeled break must be inside loop or switch(c) MDN
????Putout plugin adds ability to convert break to return. Checkout in ????Putout Editor. Merged with @putout/plugin-return.
npm i @putout/plugin-convert-break-to-return -D
{
"rules": {
"convert-break-to-return": "on"
}
}
function x() {
if (a)
break;
return false;
}
function x() {
if (a)
return;
return false;
}
MIT
Copyright 2013 - present © cnpmjs.org | Home |