tsconfig.json
What
The tsconfig.json file is the central configuration file for any TypeScript project. It tells the compiler which files to include, which files to ignore, and how strictly it should check your code.
How
A basic tsconfig.json defines the target JavaScript version and the libraries available during development:
{
"compilerOptions": {
"lib": ["esnext", "dom"],
"target": "esnext",
"strict": false
}
}
Why
TypeScript behavior is highly configurable. The tsconfig.json ensures that everyone on a team (and your CI/CD pipeline) is using the same rules. It allows you to target older browsers with target: "es5" or use the latest features with target: "esnext", all without changing your source code.
Summary
The tsconfig.json file is the source of truth for how your TypeScript code should be validated and compiled.