Skip to content

Files

Latest commit

 

History

History
45 lines (32 loc) · 823 Bytes

Style-AndOr.md

File metadata and controls

45 lines (32 loc) · 823 Bytes

Pattern: Use of and/or

Issue: -

Description

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.

Examples

# 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

Default configuration

Attribute Value
EnforcedStyle always
SupportedStyles always, conditionals

Further Reading