Why this matters
Prevents typos and eases refactors and localization.
Replace magic strings with constants or enums sealed classes; keep them in a single source of truth.
Prevents typos and eases refactors and localization.
Side-by-side examples engineers can pattern-match during review.
if (status == "active") { /*...*/ }object Status { const val ACTIVE = "active" }
if (status == Status.ACTIVE) { /*...*/ }"ready" // repeated literalconst val READY = "ready"From the same buckets as this rule.