$devtoolkit.sh/examples/config/tsconfig-strict

Strict TypeScript tsconfig for a React App

Enabling strict mode in TypeScript activates a collection of checks that catch the most common categories of runtime errors at compile time. This configuration sets the strictest possible options including noUncheckedIndexedAccess and exactOptionalPropertyTypes that are not included in the standard strict flag. The JSON formatter verifies the file is valid JSON before the TypeScript compiler reads it. Start strict from day one on new projects — retrofitting strict checks onto an existing codebase requires fixing many implicit-any and null-check errors.

Example
{
  "compilerOptions": {
    "target": "ES2022",
    "lib": ["ES2022", "DOM", "DOM.Iterable"],
    "module": "ESNext",
    "moduleResolution": "bundler",
    "jsx": "react-jsx",
    "strict": true,
    "noUncheckedIndexedAccess": true,
    "exactOptionalPropertyTypes": true,
    "noImplicitReturns": true,
    "noFallthroughCasesInSwitch": true,
    "forceConsistentCasingInFileNames": true,
    "skipLibCheck": true,
    "baseUrl": ".",
    "paths": {
      "@/*": ["./src/*"]
    }
  },
  "include": ["src"],
  "exclude": ["node_modules", "dist"]
}
[ open in JSON Formatter → ]

FAQ

What does noUncheckedIndexedAccess do?
It adds undefined to the type of array and object index access results. Without it, array[0] has type T even if the array is empty. With it, you must handle the undefined case, preventing many runtime crashes.
Should I enable skipLibCheck?
Yes for most projects. skipLibCheck skips type checking of declaration files in node_modules. Checking them is slow and often flags bugs in third-party types that you cannot fix.
What is the difference between strict and strictest TypeScript?
The strict flag enables strictNullChecks, noImplicitAny, strictFunctionTypes, and others. Strictest adds noUncheckedIndexedAccess and exactOptionalPropertyTypes on top, which strict does not include.

Related Examples

/examples/config/tsconfig-strictv1.0.0