tsconfig
- The config file. tsconfig.json is the compiler’s contract: which files, which strictness, what output.
- include and exclude. The include patterns pick what is checked: a file outside them silently escapes the compiler.
- extends. A shared base config plus per-package extends keeps a whole repo’s settings in one place.
Strictness and Compiler Options
- strict mode. The strict flag switches on the checks that make TypeScript worth it: new projects start there, no debate.
- noUncheckedIndexedAccess. With unchecked indexed access off the table, array lookups honestly admit they may be undefined.
- Migrating up. Legacy code climbs strictness one flag at a time: each flag a ratchet that never loosens again.
Build Targets and Module Formats
- target. The target option picks the JavaScript era emitted: newer targets keep modern syntax, older ones transpile it away.
- module format. The module option picks the emitted format: ESM or CommonJS: and must match where the code will run.
- Declaration output. The declaration flag emits .d.ts files alongside JavaScript: the types your consumers will install.
Before and after this level
- Before: Level 8: Modules & Projects: Imports and Exports, Module Resolution, Organising Large TypeScript Systems.
- Next: Level 10: Async & External Data: Typed Promises and Async Code, API Response Types, Runtime Validation vs Compile-Time Types.
In the app each of these ideas is taught and then asked back, and the level ends with a checkpoint and flashcards. See Checkpoints and flashcards.
Frequently asked questions
What does TypeScript Level 9: Compiler & Configuration cover?
tsconfig, Strictness and Compiler Options, Build Targets and Module Formats: 3 lessons and 9 ideas.
What should I know before this level?
The level before it, Level 8: Modules & Projects, which covers Imports and Exports, Module Resolution, Organising Large TypeScript Systems.