Skip to content

[Enhancement] Add a TypeScript strict follow-through pass for noUncheckedIndexedAccess and exactOptionalPropertyTypes #1029

Description

@RUKAYAT-CODER

Overview

tsconfig.json enables strict: true but not noUncheckedIndexedAccess or exactOptionalPropertyTypes. The codebase has patterns that both would catch: RATE_LIMIT_DELAYS[delayIndex] || RATE_LIMIT_DELAYS[RATE_LIMIT_DELAYS.length - 1] in axios.config.ts guards an index access with ||, which noUncheckedIndexedAccess would surface properly; and there are 25 TS18046 (is of type unknown) plus 55 as any casts in src/ indicating the current strictness is already being worked around. This should follow the 520-error cleanup rather than precede it.

Specifications

Features:

  • noUncheckedIndexedAccess enabled after the existing error backlog is cleared
  • exactOptionalPropertyTypes evaluated and enabled if the churn is acceptable
  • The 55 as any casts reduced

Tasks:

  • Complete the existing type-error cleanup first
  • Enable each flag in isolation and measure the new error count
  • Fix or explicitly suppress the resulting errors
  • Track as any usage with a lint rule and a decreasing budget

Impacted Files:

  • tsconfig.json
  • src/

Acceptance Criteria

  • Both flags are enabled with a clean type check
  • as any usage is measured and decreasing
  • Index accesses are narrowed rather than guarded with ||

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions