typescript-best-practices

Installation
SKILL.md

TypeScript Best Practices

Goal

Make code safer and easier to change. Use TypeScript to model real constraints without adding noise.

Rules

  • Prefer unknown over any.
  • Let inference work for local values.
  • Add explicit types at boundaries: exports, API input/output, public functions.
  • Enable strict compiler options when project allows.
  • Use discriminated unions for state variants.
  • Narrow unknown data before use.
  • Prefer interface for object shapes.
  • Prefer type for unions and utility types.
  • Avoid type assertions unless crossing a known boundary.
  • Keep runtime validation near external input.
Installs
15
GitHub Stars
7
First Seen
May 4, 2026
typescript-best-practices — flpbalada/fb-skills