The TypeScript Toolchain
A typical project uses the TypeScript compiler (tsc) to type-check and emit JavaScript, while a bundler or framework may handle transformation as part of its build. These are related but distinct jobs: type checking verifies compatibility with the type system; bundling resolves modules and packages assets; runtime execution runs JavaScript.
Some tools transpile TypeScript quickly without performing full type checking. In those setups, run tsc --noEmit or an equivalent type-check step in CI. Keep the compiler version and project configuration consistent across local development and deployment.
{
"scripts": {
"typecheck": "tsc --noEmit",
"build": "tsc",
"start": "node dist/index.js"
}
}typecheck checks the project without writing JavaScript. build emits output according to tsconfig.json. These commands are examples; a frontend framework may use its own build command while keeping a separate type-check script.- Type checking and bundling are different responsibilities.
tsc --noEmitis useful when another tool handles transpilation.- CI should run type checking so editor-only feedback is not the sole protection.
A transpiler strips TypeScript syntax but does not type-check the whole project. What should CI run to catch type errors?