Home / Market / typescript exhaustive switch

typescript exhaustive switch

Cursor native project rules: typescript-exhaustive-switch

cursor-rule★ 210700 dlgithubMITInstall in CosmosUpstream Source

Documentation & Preview

--- description: Use exhaustive switch handling for TypeScript unions and enums alwaysApply: true

---

typescript-exhaustive-switch: In switch statements over discriminated unions or enums, use a never check in the default case so newly added variants cause compile-time failures until handled.