Skip to main content

TypeScript

What is TypeScript

TypeScript is a typed superset of JavaScript that compiles to plain JS. Developed by Microsoft, it is Apache-2.0 licensed and currently at version 5.x. With ~123.7M weekly npm downloads, it has become the default choice for any serious JavaScript project.

Why we recommend it

  • Type safety — catches entire categories of bugs at compile time instead of at runtime in production.
  • IDE support — autocompletion, inline docs, and refactoring tools work dramatically better with types.
  • Scales with teams — explicit interfaces and types serve as living documentation. New contributors understand a codebase faster.
  • Gradual adoption — you can introduce TypeScript incrementally into an existing JavaScript project. Start strict where it matters, relax where it doesn't.
  • Industry standard — most modern frameworks (React, Next.js, Angular, Nest.js) are written in TypeScript and provide first-class type definitions.
tip

You don't have to convert everything at once. Rename .js files to .ts one at a time and let the compiler guide you. Gradual adoption is a first-class workflow in TypeScript.

When to use

  • All new Aliz frontend and Node.js projects — this is the default. If you're starting fresh, use TypeScript.
  • Shared libraries and packages — types make your API surface explicit and prevent misuse.

When NOT to use

  • Quick throwaway scripts where the overhead of type annotations outweighs the benefit (e.g., a one-off data migration script).
  • Avoid complex type gymnastics — if a type definition is harder to read than the code it protects, simplify it. Types should help, not hinder.

Resources