--- description: TypeScript strict mode and exhaustive unions. globs: "**/*.ts,**/*.tsx" alwaysApply: false --- # Strict TypeScript - Keep `"strict": true`. Do not silence a new error with `any`. - For a union, the default branch should assign the value to `never` so a new case breaks the build. - Prefer a named type for a form payload over a bag of optional strings. - Parse outside data at the boundary. Inside the app, the type should already be true.