tsc
The command-line TypeScript compiler, which type-checks a project and writes JavaScript and declaration files.
In more detail
Running tsc in a folder with a tsconfig.json compiles the whole project using that configuration. tsc --noEmit only checks types, which is the usual step in continuous integration. By default tsc still writes JavaScript even when there are type errors, unless noEmitOnError is set.
Examples
bunx tsc --versiontsc --noEmittsc --target ES5 app.tsRelated terms
- tsconfig.json — The configuration file that tells the TypeScript compiler which files to check and how strict to be.
- noEmit — The compiler option that makes tsc check types without writing any output files.
- noEmitOnError — The compiler option that stops tsc from writing any JavaScript if the project has type errors.
- compiler — A program that translates source code a person wrote into a form a machine or runtime can execute, checking it for errors on the way.
Taught in
- Why TypeScript: Contracts, Erased Types And Soundness — Production TypeScript
- The Compiler Pipeline: tsc, AST And Code Emission — Production TypeScript
- Type Annotations, Type Inference And Contextual Typing — Production TypeScript
- Verify Your Environment: Running tsc And Bun TypeScript — Production TypeScript
- Why Generics: Functions, Identities And Type Variables — Production TypeScript
- The Spine Artifact: Generating Typed Models From OpenAPI — Production TypeScript