Skip to content

MAINT: Adopt noUncheckedIndexedAccess in frontend (#3729) - #3982

Merged
Roman Lutz (romanlutz) merged 3 commits into
microsoft:mainfrom
Kaap10:feat/frontend-no-unchecked-indexed-access-3729
Nov 9, 2026
Merged

Roman Lutz (romanlutz) merged 3 commits into
microsoft:mainfrom
Kaap10:feat/frontend-no-unchecked-indexed-access-3729

Conversation

@Kaap10

@Kaap10 Vardhman Gupta (Kaap10) commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Description

Part of #3729: implements Stage 1 (noUncheckedIndexedAccess).

This PR addresses Stage 1 of the frontend strict type-safety migration outlined by Roman Lutz (@romanlutz) in #3729:

  • Enables "noUncheckedIndexedAccess": true in frontend/tsconfig.json.
  • Resolves all 113 compiler diagnostics produced across 35 frontend source files using explicit defensive narrowing (such as arr[0] ?? default, match?.[1] ?? '', and if (entry === undefined) return).
  • Confines changes strictly to Stage 1 without touching subsequent backlog items (exactOptionalPropertyTypes or strict-type-checked).
  • Preserves all existing lint rules, including react-hooks/exhaustive-deps, with zero compiler or linter suppressions added.

Tests and Documentation

Ran full frontend verification locally:

  • npm run type-check (npx tsc --noEmit): 0 errors
  • npx tsc -p tsconfig.test.json --noEmit: 0 errors
  • npm run lint: 0 errors, 0 warnings
  • npm run build: Vite production bundle built cleanly
  • Unit tests (npx jest): passed key suites covering modified modules (routeParams.test.ts, seedImport.test.ts, media.test.ts, conversationExport.test.ts, presetRunSizes.test.ts, attackAnalytics.test.ts, useChatConverters.test.tsx, useTour.test.ts, scenarioHierarchy.test.ts, scenarioMarkdown.test.ts, parameterForm.test.ts, AuthProvider.test.tsx, CreateTargetDialog.test.tsx, MessageList.test.tsx).

Copilot AI balanced review requested due to automatic review settings November 5, 2026 15:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@romanlutz Roman Lutz (romanlutz) self-assigned this Nov 9, 2026
Resolve the retired History filter helper conflict and keep exact numeric rendering compatible with noUncheckedIndexedAccess.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Preserve the newly landed scenario execution ordering fix and regression tests.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants