tsconfig
In one line
tsconfig.json is the configuration file that tells the TypeScript compiler how to compile: target, strictness, module system, file inclusion/exclusion, and more.
In simple words
tsconfig.json is the control center for a TypeScript project. It specifies compiler options like the JavaScript target version, strictness level, module system, output directory, and which files to include or exclude.
Key options include: target (e.g., ES2020), strict (enables all strict checks), module (e.g., ESNext), outDir (output directory), rootDir (source directory), lib (available APIs), and paths (path aliases).
Without tsconfig.json, the compiler uses default settings. Every TypeScript project should have one. It is also used by IDEs and build tools to understand the project structure.
Example
{
"compilerOptions": {
"target": "ES2022",
"strict": true,
"module": "ESNext",
"outDir": "./dist",
"rootDir": "./src"
},
"include": ["src/**/*"]
}A typical tsconfig.json with strict mode, ES2022 target, and src-to-dist compilation.
Related terms
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.