tsconfig.json
The configuration file that tells the TypeScript compiler which files to check and how strict to be.
In more detail
It sets options such as strictness, target JavaScript version and module format. Projects can extend a shared base config.
Examples
A base tsconfig in packages/ that each app extends.{ "compilerOptions": { "target": "ES2022", "module": "NodeNext", "strict": true }, "include": ["src/**/*"] }Related terms
- TypeScript — JavaScript with added type annotations, checked by a compiler before the code runs.
- compile time — The moment source code is checked and translated by a compiler, before the program runs, as opposed to run time.
- monorepo — A single version-control repository that holds several related projects, such as a web app, an API and their shared libraries.
- compilerOptions — The section of tsconfig.json, or the command-line flags, that control how tsc checks and emits code.
- strict (compiler option) — The strict compiler option, which turns on a family of stronger checks such as strictNullChecks and noImplicitAny in one setting.
- target (compiler option) — The compiler option that chooses which ECMAScript edition the emitted JavaScript uses, such as ES2022.
- module resolution — How a runtime or tool turns the name in an import, such as ./util.js or express, into the exact file to load.
- extends — A keyword with three jobs in TypeScript: a class inheriting from another, a limit on a generic type parameter, and a tsconfig.json inheriting a base file.
Taught in
- Monorepo Architecture: Workspaces & Turborepo — Production Full-Stack Engineering
- The Compiler Pipeline: tsc, AST And Code Emission — Production TypeScript
- tsconfig.json: target, lib, strict And NodeNext — Production TypeScript
- Verify Your Environment: Running tsc And Bun TypeScript — Production TypeScript