Q02. What is the difference between type checking and transpilation?
Type checking analyzes whether expressions satisfy their types. Transpilation transforms syntax into a target language or version. Some tools transpile TypeScript without performing full type checking, so projects may need a separate tsc --noEmit step.
A fast transpiler may emit JavaScript even if the project has type errors. CI should explicitly run the type checker when the build tool does not.
Note
Interview approach: define the concept, explain why it matters, then mention one trade-off or limitation.
Separate type-check step
npx tsc --noEmit💡 This checks types without emitting output, which is useful when a separate tool transpiles source.
Key Takeaways
- Explain the concept in your own words.
- Know the practical trade-off and its limits.
- Use a small example to demonstrate the idea.
Knowledge Check
Which command is commonly used to type-check without emitting files?