Lessons in this course (9)

8. tsconfig, strict mode and modules

Intermediate★ Must knowLesson 8 of 9
json
{
  "compilerOptions": {
    "target": "ES2022",
    "module": "ESNext",
    "moduleResolution": "Bundler",
    "strict": true,
    "noUncheckedIndexedAccess": true,
    "noImplicitOverride": true,
    "esModuleInterop": true,
    "skipLibCheck": true,
    "jsx": "react-jsx",
    "baseUrl": ".",
    "paths": { "@/*": ["src/*"] }
  },
  "include": ["src"]
}

strict: true turns on noImplicitAny, strictNullChecks, strictFunctionTypes, strictPropertyInitialization, useUnknownInCatchVariables and more — always enable it in new projects.

Modules: ES modules (import/export); import type { Order } from "./models" imports types only (erased); declaration files (.d.ts) describe JavaScript libraries — types come from the package itself or @types/* (DefinitelyTyped).