Reputation: 500
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.
Upvotes: 3
Views: 1681
Reputation: 386560
Just return the result of the condition. The comparison returns a boolean value.
return isActiveDate < 0;
Upvotes: 3