Skip to main content

Plain JavaScript

Discouraged

Not our default choice. Use TypeScript for all new projects.

What is itโ€‹

Writing JavaScript without static type annotations, relying on runtime behavior and dynamic typing.

Why it's not our defaultโ€‹

  • TypeScript is the industry standard โ€” adoption at >80% for professional projects; most libraries ship with TypeScript types.
  • No compile-time error checking โ€” bugs that TypeScript catches at build time become runtime errors.
  • Poor IDE support compared to TS โ€” TypeScript enables autocompletion, refactoring, inline docs, and navigation.
  • Harder to maintain at scale โ€” lack of type contracts between modules makes refactoring risky and onboarding slow.
  • All Aliz stack tools assume TypeScript โ€” Vite, Vitest, React, Zustand, TanStack Query all have first-class TS support.

When it makes senseโ€‹

  • Quick throwaway scripts โ€” one-off data migrations, local utilities, or short-lived experiments where type annotation overhead outweighs the benefit.
  • Prototypes you will delete โ€” if the code won't survive past a sprint, TypeScript setup cost may not be justified.

Alternativeโ€‹

TypeScript

Migration pathโ€‹

  1. Add TypeScript: npm install -D typescript and create tsconfig.json
  2. Rename files incrementally: .js โ†’ .ts, .jsx โ†’ .tsx
  3. Start with "strict": false in tsconfig, then progressively enable strict checks
  4. Use // @ts-expect-error or any temporarily for complex legacy patterns
  5. Add types for dependencies: npm install -D @types/react @types/node etc.

Resourcesโ€‹