typescript
Strict TypeScript baseline: no any, narrowing on unknown, exhaustive switches, no enums.
npx rulepack add typescript
What it covers
- A strict tsconfig baseline kept on:
strict,noUncheckedIndexedAccess,noImplicitOverride,noFallthroughCasesInSwitch,noUnusedLocals/noUnusedParameters,verbatimModuleSyntax - Type discipline: never
any(type asunknownand narrow), union literals over enums,satisfiesfor conformance,asonly as a last resort with a comment - Patterns: discriminated unions for state machines,
Result<T, E>-style returns over throwing for expected failures, branded types for IDs - Module shape: types exported alongside their values,
import type { … }for type-only imports, explicit export surface instead of catch-all barrels
Source
Rules align with the official TypeScript handbook & tsconfig reference: https://www.typescriptlang.org/tsconfig
License
MIT