TypeScript · Lesson 76 of 120
tsconfig.json
The settings.
Every TypeScript project has a tsconfig dot JSON file. It tells the compiler which files to check, how strict to be, and what kind of JavaScript to write.

- One settings file
- Which files
- How strict
tsconfig.json
Strict turns on all the safety checks. Target picks the JavaScript version to write. Module and module resolution follow Node's rules. Out dir is where the JavaScript goes. And include lists the source files.
tsconfig.jsonjson
{
"compilerOptions": {
"strict": true,
"target": "ES2022",
"module": "NodeNext",
"moduleResolution": "NodeNext",
"outDir": "dist",
"skipLibCheck": true
},
"include": ["src"]
}Getting one
NPXTSC dash dash init creates a tsconfig with comments explaining every option. Frameworks usually give you one already. Start strict, and keep it strict.
| key | value |
|---|---|
| Create | npx tsc --init |
| Frameworks | provide one |
| strict | always on |
| Run | npx tsc |
Summary
Tsconfig dot JSON controls what's checked, and how. Next, strict mode.
Key takeaways- strict
- target
- outDir
Next up: Strict Mode — the safety switches