Skip to main content
D
TypeScript
TypeScript tsconfig.json

TypeScript tsconfig.json

The tsconfig.json file configures the entire TypeScript compiler.

Read Time
5 min read
Difficulty
Beginner
Last Updated
Jun 15, 2026
Version
v1.0.0

Introduction

The TypeScript compiler (`tsc`) needs instructions on exactly how strict to be and what kind of JavaScript file to spit out at the end. The `tsconfig.json` file sits at the root of your project and holds all of these critical settings.

Syntax

Syntax
1/* this is a configuration file */
2{
3  "compilerOptions": {
4    "target": "es2022",
5    "module": "commonjs",
6    "strict": true
7  }
8}

Key Points

  • It is created automatically by running `tsc --init`.
  • The `target` specifies the output JavaScript version (like ES5 or ES2022).
  • The `strict` flag turns on maximum safety features.
  • It controls where the final compiled files are saved.

Up Next

Continue your journey with the next topic.

Go to TS Strict Mode