intermediate
tsconfig and project references
Shape compiler strictness, module settings, path aliases, incremental builds, and monorepo boundaries.
`tsconfig` defines the compiler contract: strictness, `module`/`moduleResolution`, JSX mode, `lib`, path aliases, emit behavior, and incremental options. Project references split large workspaces into buildable units with explicit dependency order and faster incremental builds.
Path aliases need matching runtime or bundler configuration. `skipLibCheck` can hide declaration conflicts. Different tsconfig files can create inconsistent strictness between apps and tests.
On interviews: explain with a concrete example and name what interviewers probe in production code.
Common pitfalls: mixing similar APIs and forgetting edge cases during live coding.
The trade-off is often clarity versus safety or expressiveness versus maintainability. Checklist:
- Know core strict settings.
- Align module resolution.
- Use references for large workspaces.