README
@putout/plugin-remove-useless-condition
putout
plugin adds ability to remove useless condition
.
Install
npm i @putout/plugin-remove-useless-condition
Rule
{
"rules": {
"remove-useless-condition": "on"
}
}
❌ Incorrect code example
if (zone?.tooltipCallback) {
zone.tooltipCallback(e);
}
if (a)
alert('hello');
else
alert('hello');
✅ Correct code Example
zone?.tooltipCallback(e);
alert('hello');
License
MIT