Problem Statement
Backend tsconfig.json has several critical strict checks disabled: strictNullChecks: false, noImplicitAny: false, strictBindCallApply: false, forceConsistentCasingInFileNames: false, noFallthroughCasesInSwitch: false. This allows type errors that would be caught at compile time to instead manifest as runtime bugs.
Evidence
Backend/tsconfig.json lines 14-18: All strict checks disabled
Impact
Type errors that could be caught at compile time manifest as runtime issues. Refactoring is higher risk. Developer experience is degraded (less IDE assistance).
Proposed Solution
- Enable strictNullChecks and fix all resulting null/undefined errors
- Enable noImplicitAny and add explicit type annotations
- Enable forceConsistentCasingInFileNames
- Enable noFallthroughCasesInSwitch
- Fix all type errors incrementally
- Add // @ts-expect-error comments only where absolutely necessary
Technical Requirements
- Must not change runtime behavior
- Must be done incrementally (enable one flag at a time, fix, commit)
- Must keep codebase TypeScript 5.7 compatible
Acceptance Criteria
- strictNullChecks enabled with zero errors
- noImplicitAny enabled with zero errors
- forceConsistentCasingInFileNames enabled with zero errors
- noFallthroughCasesInSwitch enabled with zero errors
- npm run build succeeds
- npm run test passes
- npm run lint passes
- No @ts-ignore comments added
File Inventory
Dependencies
None.
Testing Strategy
- Run TypeScript compiler with new flags:
npx tsc --noEmit
- Run all tests to ensure no behavioral changes
Security Considerations
Strict type checking prevents type confusion bugs that could have security implications.
Definition of Done
Problem Statement
Backend tsconfig.json has several critical strict checks disabled:
strictNullChecks: false,noImplicitAny: false,strictBindCallApply: false,forceConsistentCasingInFileNames: false,noFallthroughCasesInSwitch: false. This allows type errors that would be caught at compile time to instead manifest as runtime bugs.Evidence
Backend/tsconfig.jsonlines 14-18: All strict checks disabledImpact
Type errors that could be caught at compile time manifest as runtime issues. Refactoring is higher risk. Developer experience is degraded (less IDE assistance).
Proposed Solution
Technical Requirements
Acceptance Criteria
File Inventory
Backend/tsconfig.jsonDependencies
None.
Testing Strategy
npx tsc --noEmitSecurity Considerations
Strict type checking prevents type confusion bugs that could have security implications.
Definition of Done