I am trying this code with ESLint
Code snippet:
if (disableFutureDates) {
return isActiveDate < 0 ? true : false; //error
}
Got this ESLint error: error Unnecessary use of boolean literals in conditional expression.
I am trying this code with ESLint
Code snippet:
if (disableFutureDates) {
return isActiveDate < 0 ? true : false; //error
}
Got this ESLint error: error Unnecessary use of boolean literals in conditional expression.
Just return the result of the condition. The comparison returns a boolean value.
return isActiveDate < 0;