SuperAPI AI Directory

typescript-best-practices

Coding & development

View repository

Updated 10-16 05:02

About this skill

TypeScript Best Practices

Treat types as precise, compiler-checked models of valid program states and boundaries; preserve inference where it carries information, then narrow uncertainty explicitly so invalid states and unhandled cases cannot silently reach runtime.

Effective Strategies for TypeScript

Read the references that apply to the current task before writing or reviewing TypeScript.

  1. Preserve TypeScript's specific inference whenever it proves the intended contract.
  2. Model domain contracts and closed states precisely.
  3. Narrow uncertainty and absence explicitly at the boundary that owns it.