@putout/plugin-remove-useless-else
v2.0.2
Published
šPutout plugin adds ability to remove useless else
Downloads
7,382
Maintainers
Readme
@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
.
Install
npm i @putout/plugin-remove-useless-else
Rule
{
"rules": {
"remove-useless-else": "on"
}
}
ā Example of incorrect code
if (x)
return;
else
console.log();
ā Example of correct code
if (x)
return;
console.log();
License
MIT