Jamie Balfour

Welcome to my personal website.

Find out more about me, my personal projects, reviews, courses and much more here.

Part 2.2Configuring TypeScript

A tsconfig.json file tells the compiler which files belong to a project and which checks should be enabled. Create one with npx tsc --init.

tsconfig.json

tsconfig.json
{
  "compilerOptions": {
    "target": "ES2022",
    "module": "ESNext",
    "strict": true,
    "outDir": "dist"
  },
  "include": ["src"]
}

Strict checking

Use "strict": true in new projects. It enables a family of checks that make missing values, unsafe parameters and incomplete object handling visible. Strict code may require more thought initially, but that is the point: it makes the program describe what it actually expects.

Feedback 👍
Comments are sent via email to me.