TypeScript Recipes
View CommandsTypeScript compiler commands for type checking, building, and configuring projects with strict type safety.
8 recipes
Build Pipeline with tsup for TypeScript Libraries
Set up a fast build pipeline using tsup to produce ESM, CJS, and declaration files for publishable TypeScript packages.
Optimize tsconfig for Modern Projects
Configure tsconfig.json with the best compiler options for modern TypeScript projects targeting Node.js, React, or library development.
Generate Declaration Files for TypeScript Libraries
Configure TypeScript to generate .d.ts declaration files and declaration maps for publishable libraries with proper package.json exports.
Set Up TypeScript ESLint with Type-Aware Rules
Configure ESLint with typescript-eslint for type-aware linting rules that catch bugs the compiler misses, including no-floating-promises and consistent-type-imports.
Migrate a JavaScript Project to TypeScript
Convert an existing JavaScript project to TypeScript incrementally by renaming files, adding types, and enabling strict mode over time.
Monorepo Setup with TypeScript Project References
Configure TypeScript project references to build, type-check, and navigate across multiple packages in a monorepo with incremental compilation.
Migrate to Strict TypeScript Incrementally
Enable strict mode in an existing TypeScript project one flag at a time to avoid a massive migration and catch type errors gradually.
Add TypeScript Type Checking to CI/CD
Configure continuous integration to run TypeScript type checking on every pull request, catching type errors before they reach production.