DashboardcliUPGRADE_SOURCES nonempty tuple

UPGRADE_SOURCES nonempty tuple

Category: gotcha
Confidence: 1.00
ID: 01a08643-d0b4-7fb3-89bd-0296f98ebbd1
Project ID: c760f4f9-42b0-4ce0-b36d-6b8c38d770b2
Cross-project: No
Recalled in other projects: 0
Source session: 0Sur2JFiaKMSPqD4h
Created: 2026-09-09 13:03:06
Updated: 2026-09-09 13:03:06

Content

Trap: typing UPGRADE_SOURCES as readonly UpgradeSource[] looks sufficient, but noUncheckedIndexedAccess makes UPGRADE_SOURCES[0] possibly undefined and contaminates every default source parameter. Fix: declare it with as const satisfies readonly [UpgradeSource, ...UpgradeSource[]]; this proves the ordered fallback list is nonempty while validating every element.

Move to: