Saltar al contenido principal

avoid-unnecessary-conditionals

added in: 1.0.0 warning

Checks for unnecessary conditional expressions.

Example

Bad:

bool baz() => foo ? true : false; // LINT

bool bar() => foo ? false : true; // LINT

Good:

bool baz() => foo;

bool bar() => !foo;