oxidecomputer / oxidecomputer/console

Turn on TS config option `noUncheckedIndexedAccess`

Open
#1,906 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

tools
Dominant language
TypeScript
Stars
228
Forks
22
Avg merge
19h 42m
Merged PRs (30d)
32

Description

There are 86 errors when I try it, so it's non-trivial. But I think it's a good check. Basically it makes array[0] have type T | undefined unless you've checked that the array is not empty.

https://www.typescriptlang.org/tsconfig#noUncheckedIndexedAccess

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the repository's TypeScript configuration and run the compiler with noUncheckedIndexedAccess enabled to reproduce the 86 errors. Review the affected code and resolve the reported undefined-access cases; the work is done when the option is enabled without remaining type errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
build-system
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.