Skip to content

noUncheckedIndexedAccess migration: enforce the ratchet everywhere #85

Description

@rebaserHEAD

PR #83 landed the flag as a ratchet: scripts/check-strict-indexing.mjs runs tsc with --noUncheckedIndexedAccess over the whole program and fails CI only for cleaned directories. algorithms/, settings/, validation/, hooks/ are enforced. The endgame is deleting the script and putting the flag in tsconfig.

Remaining, by error count at adoption (recorded in the script):

Directory Errors
state/ 155
tools/ 115
export/ 102
rendering/ 100
import/ 74
prefab/ 65
components/ 61
loaders/ 37
tests/ 22
App.tsx 3

state/ first: it is the reducer, and an unchecked index there is a tile written into the wrong chunk that you find out about when a map will not load in-game.

Per-slice recipe: clean the directory, add it to CLEAN_DIRS, run the full suite plus the parity sweep (for export/import/state slices). Prefer as const offset tables and optional chaining over ! — ESLint types the code without the flag, so non-null assertions read as unnecessary there and get flagged (see da5f92f).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions