Description
TypeScript strict mode is not enabled across the monorepo packages. This means:
any types are silently allowed, hiding potential runtime errors
- Implicit
undefined from array/object indexing is not caught
- Null checks are not enforced (
strictNullChecks disabled)
- No
noUncheckedIndexedAccess — accessing arr[5] on a 3-element array silently returns undefined
- Function parameter bivariance is allowed (
strictFunctionTypes disabled)
These unchecked types lead to runtime errors that TypeScript should catch at compile time. The SDK and backend services have complex data flows where strict typing is critical for reliability.
Files to Modify
packages/sdk/tsconfig.json — Enable strict mode
packages/indexer/tsconfig.json — Enable strict mode
packages/dm-relay/tsconfig.json — Enable strict mode
packages/analytics-oracle/tsconfig.json — Enable strict mode
packages/types/tsconfig.json — Enable strict mode
- All TypeScript source files — Fix type errors resulting from strict mode
Implementation Guide
- Enable strict mode incrementally per package:
{
"compilerOptions": {
"strict": true,
"noUncheckedIndexedAccess": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"exactOptionalPropertyTypes": true
}
}
- Start with
packages/types (shared types) — fix errors there first
- Then
packages/sdk — the most critical package
- Then backend services: indexer, DM relay, analytics oracle
- Common fixes needed:
- Add null checks for array/object indexing
- Replace
any with proper types
- Add explicit return types to functions
- Handle
undefined from .find(), .get(), etc.
- Add type guards for conditional type narrowing
Acceptance Criteria
How to Start Contributing
- Fork and branch:
git checkout -b chore/typescript-strict-mode
- Start with
packages/types/tsconfig.json — enable strict, fix errors
- Move to each package sequentially
- Use
pnpm run typecheck to verify each package
- Run
pnpm run lint across all packages
- Open PR with list of type bugs caught and fixed
Difficulty Note
This is a large-scale change that will touch many files. Consider breaking it into multiple PRs:
- PR 1: Enable strict in
packages/types
- PR 2: Enable strict in
packages/sdk
- PR 3: Enable strict in backend services
Description
TypeScript strict mode is not enabled across the monorepo packages. This means:
anytypes are silently allowed, hiding potential runtime errorsundefinedfrom array/object indexing is not caughtstrictNullChecksdisabled)noUncheckedIndexedAccess— accessingarr[5]on a 3-element array silently returnsundefinedstrictFunctionTypesdisabled)These unchecked types lead to runtime errors that TypeScript should catch at compile time. The SDK and backend services have complex data flows where strict typing is critical for reliability.
Files to Modify
packages/sdk/tsconfig.json— Enable strict modepackages/indexer/tsconfig.json— Enable strict modepackages/dm-relay/tsconfig.json— Enable strict modepackages/analytics-oracle/tsconfig.json— Enable strict modepackages/types/tsconfig.json— Enable strict modeImplementation Guide
{ "compilerOptions": { "strict": true, "noUncheckedIndexedAccess": true, "noImplicitReturns": true, "noFallthroughCasesInSwitch": true, "exactOptionalPropertyTypes": true } }packages/types(shared types) — fix errors there firstpackages/sdk— the most critical packageanywith proper typesundefinedfrom.find(),.get(), etc.Acceptance Criteria
strict: truein all package tsconfig.json filesnoUncheckedIndexedAccess: truein all packagesanytypes remain (replace with proper types orunknown)pnpm run typecheckpasses across all packagespnpm run lintpassestsc --noEmitoutput showing zero errorsHow to Start Contributing
git checkout -b chore/typescript-strict-modepackages/types/tsconfig.json— enable strict, fix errorspnpm run typecheckto verify each packagepnpm run lintacross all packagesDifficulty Note
This is a large-scale change that will touch many files. Consider breaking it into multiple PRs:
packages/typespackages/sdk