Skip to content

Files

Latest commit

 

History

History
23 lines (14 loc) · 583 Bytes

Lint-OrAssignmentToConstant.md

File metadata and controls

23 lines (14 loc) · 583 Bytes

Pattern: or-assignment to a constant

Issue: -

Description

Constants should always be assigned in the same location. And its value should always be the same. If constants are assigned in multiple locations, the result may vary depending on the order of require.

Also, if you already have such an implementation, auto-correction may change the result.

Examples

# bad
CONST ||= 1

# good
CONST = 1

Further Reading