TS Compilation
Question
What does the TypeScript compiler do?
Hint
tsc removes types and outputs JS (targeting ES3 to ESNext).
Explanation
The TypeScript compiler (tsc) performs two jobs: 1) Type-checking — verifies types are correct, reports errors. 2) Transpilation — removes type annotations and converts TS syntax to JS. The output JS version is controlled by the target option (ES3, ES5, ES2015, ..., ESNext). tsc can also emit declaration files (.d.ts) for libraries. With noEmit: true, it only type-checks. Modern projects often use tsc for type-checking and a separate bundler (esbuild, swc, Vite) for transpilation, which is faster.
Related Resources
Related Lessons
- TS Overview
Learn TS basics.
Look up unfamiliar terms
A beginner-friendly glossary explains jargon in plain English — variables, functions, DOM, Promise, and more.
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.
Build real projects
Apply what you learned by building guided projects with starter code and solutions.