avoid-unnecessary-conditionals
preset: recommended
Checks for unnecessary conditional expressions.
Example
❌ Bad:
bool baz() => foo ? true : false; // LINT: Avoid unnecessary conditional expressions. Try using the condition directly.
bool bar() => foo ? false : true; // LINT: Avoid unnecessary conditional expressions. Try using the condition directly.
✅ Good:
bool baz() => foo;
bool bar() => !foo;