@putout/plugin-remove-double-negations
To explicitly convert its return value (or any expression in general) to the corresponding boolean value can be used a double NOT operator (
!!
).(c) MDN
Install
npm i @putout/plugin-remove-double-negations
Rule
{
"rules": {
"remove-double-negations": "off"
}
}
❌ Example of incorrect code
if (!!a) {
console.log('hi');
}
✅ Example of correct code
if (a) {
console.log('hi');
}
License
MIT