Skip to content
Critiq Docs

Search docs

Search documentation pages and rules

correctness.language

Duplicate switch case labels

A switch repeats the same case discriminant.

#Metadata

Rule ID
ts.correctness.duplicate-switch-case
Severity
medium
Confidence
0.9
Languages
javascript, typescript
Presets
recommended, strict
Stability
stable
Applies to
file
Tags
correctness, crq-cor-019, language, public-directory-parity, rules-catalog

#Why it matters

Unreachable duplicate cases usually mean a merge error or incomplete refactor.

#Remediation

Delete the unreachable duplicate case or change the discriminant so each branch is distinct.

#Repository path

The generated metadata points to critiq-rules/libs/rules/catalog/rules/typescript/ts.correctness.duplicate-switch-case.rule.yaml.