Skip to content

[Frontend] tsconfig.json — enable noUncheckedIndexedAccess and noUnusedLocals #650

@ogazboiz

Description

@ogazboiz

Join the discussion on Telegram

Why this matters

frontend/tsconfig.json has \"strict\": true but is missing the safer-strict family that the backend tsconfig already enables:

Backend backend/tsconfig.json has:

\"noUncheckedIndexedAccess\": true,
\"exactOptionalPropertyTypes\": true,

Frontend has neither. The frontend has many obj[key] accesses (in localStorage parsing, stream maps, etc.) that silently assume the value exists. Turning on noUncheckedIndexedAccess is a great win for catching real bugs (e.g. fractionalPart.length on a possibly-undefined value in frontend/src/lib/amount.ts:98 — likely unreachable but no longer relies on luck).

noUnusedLocals would also surface the dead constant in frontend/src/lib/dashboard.ts:46 (filed separately) and any others.

Acceptance criteria

  • Add noUncheckedIndexedAccess: true to frontend/tsconfig.json
  • Add noUnusedLocals: true
  • Fix or annotate the call sites the new check surfaces — expect 5-15 small changes
  • npm run build passes
  • Do NOT also add exactOptionalPropertyTypes in the same PR (too noisy; separate issue)

Files to touch

  • frontend/tsconfig.json
  • whichever frontend/src/** files the type-checker now complains about

Out of scope

  • Enabling exactOptionalPropertyTypes (deferred to separate issue)

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programfrontendFrontend related tasksgood first issueGood for newcomersrefactorRefactoring existing code

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions