require-assert-never
Require an empty switch default to call assertNever so discriminated unions remain exhaustive at compile time.
Why
An empty default silently accepts new union members instead of making the compiler identify the missing case.
Fix
Call assertNever with the discriminant in the exhaustive switch default.
Examples
declare const kind: "a" | "b";switch (kind) { case "a": break; case "b": break; default:}declare const kind: "a" | "b";switch (kind) { case "a": break; case "b": break; default: assertNever(kind);}