typescript-best-practices

Installation
SKILL.md

TypeScript Best Practices

Type Safety

  • Enable strict: true in tsconfig.json — never disable strict checks in production code.
  • Prefer unknown over any. If any is unavoidable, add a comment explaining why and narrow it immediately.
  • Use satisfies to validate a value matches a type while preserving its narrowed literal type:
const config = {
    endpoint: "/api/users",
    timeout: 3000,
} satisfies Config;
  • Prefer type narrowing (type guards, in operator, instanceof) over type assertions (as).

Type Inference

Related skills

More from grahamcrackers/skills

Installs
9
First Seen
Feb 25, 2026