Skip to content

Files

Latest commit

 

History

History
34 lines (23 loc) · 426 Bytes

Style-RedundantConditional.md

File metadata and controls

34 lines (23 loc) · 426 Bytes

Pattern: Redundant conditional

Issue: -

Description

This rule checks for redundant returning of true/false in conditionals.

Examples

# bad
x == y ? true : false

# bad
if x == y
  true
else
  false
end

# good
x == y

# bad
x == y ? false : true

# good
x != y

Further Reading