TypeScript Configuration
Root tsconfig.base.json shared across all packages.
#Root tsconfig
All packages extend the same base configuration kept at the workspace root:
json
// tsconfig.base.json
{
"compilerOptions": {
"target": "ES2020",
"module": "ESNext",
"moduleResolution": "bundler",
"strict": true,
"exactOptionalPropertyTypes": true,
"noUncheckedIndexedAccess": true,
"declaration": true,
"declarationMap": true,
"sourceMap": true,
"esModuleInterop": true,
"skipLibCheck": true
}
}#Per-package tsconfig
Each package adds only what differs:
json
// packages/core/tsconfig.json
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "dist"
},
"include": ["src"]
}#Why strict and exactOptionalPropertyTypes?
strict enables the full TypeScript strictness suite including strictNullChecks and noImplicitAny. exactOptionalPropertyTypes adds an extra guarantee: a property declared as page?: number cannot be explicitly set to undefined — it must be omitted entirely. This prevents subtle bugs where you spread an object with an undefined field and accidentally override a default.