$ npm install @putout/plugin-remove-useless-else
You can skip the
else
block if yourif
block always executes areturn
statement, it makes code a lot easier to read.(c) no else return
🐊Putout plugin adds ability to remove useless else
. Merged to @putout/plugin-conditions
.
npm i @putout/plugin-remove-useless-else
{
"rules": {
"remove-useless-else": "on"
}
}
if (x)
return;
else
console.log();
if (x)
return;
console.log();
MIT
© 2010 - cnpmjs.org x YWFE | Home | YWFE