Pattern: Use of and
/or
Issue: -
This rule checks for uses of and
and or
, and suggests using &&
and || instead
. It can be configured to check only in conditions, or in
all contexts.
# EnforcedStyle: always (default)
# good
foo.save && return
if foo && bar
# bad
foo.save and return
if foo and bar
# EnforcedStyle: conditionals
# good
foo.save && return
foo.save and return
if foo && bar
# bad
if foo and bar
Attribute | Value |
---|---|
EnforcedStyle | always |
SupportedStyles | always, conditionals |