48 lines
1.3 KiB
JSON
48 lines
1.3 KiB
JSON
{
|
|
"compilerOptions": {
|
|
// Base strict mode
|
|
"strict": true,
|
|
|
|
// === THE FIVE EXTRA FLAGS ===
|
|
|
|
// 1. Array/object indexing returns T | undefined (not just T)
|
|
"noUncheckedIndexedAccess": true,
|
|
|
|
// 2. Optional properties (?) mean "absent", not "undefined"
|
|
"exactOptionalPropertyTypes": true,
|
|
|
|
// 3. Forces obj["key"] syntax for index signatures (explicit about dynamic access)
|
|
"noPropertyAccessFromIndexSignature": true,
|
|
|
|
// 4. Error on unused local variables
|
|
"noUnusedLocals": true,
|
|
|
|
// 5. Error on unused function parameters
|
|
"noUnusedParameters": true,
|
|
|
|
// === ADDITIONAL SAFETY ===
|
|
|
|
// Error if switch case falls through without break
|
|
"noFallthroughCasesInSwitch": true,
|
|
|
|
// Error if function doesn't explicitly return in all paths
|
|
"noImplicitReturns": true,
|
|
|
|
// Force consistent casing in imports (catches cross-platform bugs)
|
|
"forceConsistentCasingInFileNames": true,
|
|
|
|
// Ensure imports resolve correctly
|
|
"moduleResolution": "bundler",
|
|
"module": "ESNext",
|
|
"target": "ES2022",
|
|
"lib": ["ES2023", "DOM", "DOM.Iterable"],
|
|
|
|
// Isolated builds (required for most bundlers)
|
|
"isolatedModules": true,
|
|
"verbatimModuleSyntax": true,
|
|
|
|
// Skip type-checking node_modules
|
|
"skipLibCheck": true,
|
|
},
|
|
}
|