On this page
Strict tsconfig.json Reference
Prev: tsconfig_and_tooling | Up: tsconfig_and_tooling | Next: Declaration Files (.d.ts) & JS Interop
Rel: Type-Checking & Erasure Pipeline
Ref: TypeScript — TSConfig Reference
Tags: #public #web #typescript #tooling #tsconfig
Contents
Recommended Modern Baseline
{
"compilerOptions": {
"target": "ES2023",
"module": "NodeNext",
"moduleResolution": "NodeNext",
"strict": true,
"noUncheckedIndexedAccess": true,
"exactOptionalPropertyTypes": true,
"verbatimModuleSyntax": true,
"erasableSyntaxOnly": true,
"isolatedModules": true,
"skipLibCheck": true,
"noEmit": true
}
}
Key Safety & Module Flags Explained
strict: true: EnablesstrictNullChecks,noImplicitAny,strictFunctionTypes,strictBindCallApply, anduseUnknownInCatchVariables.noUncheckedIndexedAccess: true: Typesarr[i]andrecord[k]asT | undefinedinstead of blindly assuming the index exists.verbatimModuleSyntax: true: Requires explicitimport type { Foo }for type-only imports so bundlers and type-strippers never accidentally keep or drop side-effect imports.erasableSyntaxOnly: true: Forbidsenum, runtimenamespace, and parameter properties so files run directly in type-stripping runtimes.
Linked from
Related notes
- tuts/typescript/tsconfig_and_tooling Linked here; links to this page; shared tags: #tooling, #typescript, #web
- tuts/typescript/tsconfig_and_tooling/declaration_files_and_interop Linked here; links to this page; shared tags: #tooling, #typescript, #web
- tuts/typescript/type_system/type_checking_and_erasure_pipeline Linked here; links to this page; shared tags: #typescript, #web
- tuts/typescript shared tags: #typescript, #web
- tuts/typescript/builtins shared tags: #typescript, #web
- tuts/typescript/builtins/any shared tags: #typescript, #web
- tuts/typescript/builtins/as_const shared tags: #typescript, #web
- tuts/typescript/builtins/asserts shared tags: #typescript, #web
- tuts/typescript/builtins/enum shared tags: #typescript, #web
- tuts/typescript/builtins/infer shared tags: #typescript, #web