TypeScript Commands
Typed superset of JavaScript and its compiler, tsc.All TypeScript pages
- tsc --declaration --emitDeclarationOnly: generate .d.ts filesGenerate only .d.ts files with tsc --declaration --emitDeclarationOnly, for libraries built with esbuild or swc. tsconfig setup, declarationMap and pitfalls.
- tsc --init: create a tsconfig.json filenpx tsc --init writes a tsconfig.json with strict checking and modern module settings. What each generated option does, and how to pass options at creation.
- tsc --noEmit: type check a TypeScript project without emitting filesnpx tsc --noEmit type checks a TypeScript project without writing .js files. Exit codes, watch and incremental modes, and how to add it to CI and npm scripts.
- tsc file.ts: compile a single file (and why tsconfig.json is ignored)tsc file.ts compiles one file with default options and ignores tsconfig.json; TypeScript 6+ stops with TS5112. Use --ignoreConfig, or -p to keep the config.