Skip to content

Severity: warning
Category: lint
Stage: Stage 3

Description

A match arm repeats a variant tag that an earlier arm already handles. The later arm is unreachable for that variant and usually indicates a copy-paste error or incomplete refactor.

Example

type Status = Active | Inactive

// ✗ lint warning — Active handled twice
const r = match s {
  Active => 1,
  Active => 2,    // SJS-L007
  Inactive => 0,
}

Fix

Remove the duplicate arm or change it to the variant you intended:

// ✓ correct
const r = match s {
  Active => 1,
  Inactive => 0,
}

Configuration

{
  "lint": {
    "L007": "error" | "warn" | "off"
  }
}

Default: "warn" in standard mode, "error" in --strict mode.

  • SJS-L006 — empty match expression
  • SJS-E007 — non-exhaustive match (missing variants)
Documentation