tsconfig.json

suggest change

tsconfig.json uses JSON with comments. Start with strict and relax individual checks only for a documented reason. A modern Node.js ESM library configuration can look like this:

{
  "compilerOptions": {
    "target": "ES2022",
    "module": "NodeNext",
    "moduleResolution": "NodeNext",
    "rootDir": "src",
    "strict": true,
    "noUncheckedIndexedAccess": true,
    "exactOptionalPropertyTypes": true,
    "verbatimModuleSyntax": true,
    "declaration": true,
    "outDir": "dist"
  },
  "include": ["src/**/*.ts"]
}

This setup also requires the package to opt into ESM, commonly with "type": "module" in package.json. Applications may set noEmit when another tool emits JavaScript. Browser projects that use a bundler often pair module: "ESNext" with moduleResolution: "Bundler". Choose settings for the actual runtime instead of copying a supposedly universal configuration. strict does not enable noUncheckedIndexedAccess or exactOptionalPropertyTypes; they are separate, intentionally stricter checks.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents