Enable the TypeScript strict flag `noUncheckedIndexedAccess` which ensures that indexed access (arrays, Record types) includes `| undefined` in the result type, catching potential runtime errors at compile time. Current state: - 493 pre-existing type errors (before this flag) - ~234 additional errors introduced by this flag - Errors should be fixed progressively, prioritizing features/ and services/ - Pattern: use optional chaining (value?.) or null checks (if (value != null)) This flag was previously commented out with a TODO. Enabling it now ensures new code is written safely, even as existing errors are addressed over time. Addresses audit finding: debt item 10 (TypeScript strictness). Co-authored-by: Cursor <cursoragent@cursor.com>
59 lines
No EOL
1.3 KiB
JSON
59 lines
No EOL
1.3 KiB
JSON
{
|
|
"compilerOptions": {
|
|
"target": "ES2020",
|
|
"useDefineForClassFields": true,
|
|
"lib": [
|
|
"ES2020",
|
|
"DOM",
|
|
"DOM.Iterable",
|
|
"WebWorker"
|
|
],
|
|
"module": "ESNext",
|
|
"skipLibCheck": true,
|
|
"moduleResolution": "bundler",
|
|
"allowImportingTsExtensions": true,
|
|
"resolveJsonModule": true,
|
|
"isolatedModules": true,
|
|
"noEmit": true,
|
|
"jsx": "react-jsx",
|
|
/* Strict Type Checking */
|
|
"strict": true,
|
|
"noImplicitAny": true,
|
|
"strictNullChecks": true,
|
|
"strictFunctionTypes": true,
|
|
"strictBindCallApply": true,
|
|
"strictPropertyInitialization": true,
|
|
"noImplicitThis": true,
|
|
"alwaysStrict": true,
|
|
"noUnusedLocals": true,
|
|
"noUnusedParameters": true,
|
|
"noImplicitReturns": true,
|
|
"noFallthroughCasesInSwitch": true,
|
|
"noUncheckedIndexedAccess": true, // Enabled in audit remediation C12 — adds ~234 errors on top of 493 pre-existing; fix progressively
|
|
"noImplicitOverride": true,
|
|
"baseUrl": ".",
|
|
"paths": {
|
|
"@/*": [
|
|
"./src/*"
|
|
]
|
|
},
|
|
"types": [
|
|
"vite/client"
|
|
]
|
|
},
|
|
"include": [
|
|
"src"
|
|
],
|
|
"exclude": [
|
|
"src/**/*.test.ts",
|
|
"src/**/*.test.tsx",
|
|
"src/**/*.example.ts",
|
|
"src/test/**/*",
|
|
"src/mocks/**/*"
|
|
],
|
|
"references": [
|
|
{
|
|
"path": "./tsconfig.node.json"
|
|
}
|
|
]
|
|
} |