Pattern: Redundant conditional
Issue: -
This rule checks for redundant returning of true
/false
in conditionals.
# bad
x == y ? true : false
# bad
if x == y
true
else
false
end
# good
x == y
# bad
x == y ? false : true
# good
x != y
Pattern: Redundant conditional
Issue: -
This rule checks for redundant returning of true
/false
in conditionals.
# bad
x == y ? true : false
# bad
if x == y
true
else
false
end
# good
x == y
# bad
x == y ? false : true
# good
x != y