Skip to content

fix(lint): TS2345 noUncheckedIndexedAccess in standing-by-detector parseArgs#3015

Merged
AceHack merged 1 commit into
mainfrom
fix-lint-ts2345-standing-by-detector-2026-05-13
May 13, 2026
Merged

fix(lint): TS2345 noUncheckedIndexedAccess in standing-by-detector parseArgs#3015
AceHack merged 1 commit into
mainfrom
fix-lint-ts2345-standing-by-detector-2026-05-13

Conversation

@AceHack
Copy link
Copy Markdown
Member

@AceHack AceHack commented May 13, 2026

Summary

  • argv[i] inside the parseArgs loop is typed string | undefined under noUncheckedIndexedAccess
  • KNOWN_FLAGS.has(arg) fails because Set<string>.has() doesn't accept undefined
  • The loop guard i < argv.length guarantees argv[i] is always defined — add ! to narrow

Root cause

PR #3011 (B-0440.2) was squash-merged while the lint (tsc tools) non-required check was still failing. That check fired on the entire codebase and caught standing-by-detector.ts. Since the check is non-required it didn't block merge, but the bug landed on main.

PR #3013 applied the same fix pattern to missed-substrate-detector.ts. This PR applies it to standing-by-detector.ts.

Test plan

  • bun --bun tsc --noEmit -p tsconfig.json — passes clean (verified locally)
  • CI lint (tsc tools) passes

🤖 Generated with Claude Code

…rseArgs

argv[i] inside a bounds-checked loop (i < argv.length) is always
defined; add ! to narrow string|undefined to string so KNOWN_FLAGS.has()
and Set-typed methods accept it. Same fix pattern as PR #3013.

Co-Authored-By: Claude <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 13, 2026 18:28
@AceHack AceHack enabled auto-merge (squash) May 13, 2026 18:28
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR applies a focused TypeScript strictness fix in the Standing-by detector argument parser, matching the previously applied sibling fix for missed-substrate-detector.ts.

Changes:

  • Adds a non-null assertion to argv[i] inside a loop guarded by i < argv.length.
  • Documents why the assertion is safe under noUncheckedIndexedAccess.

@AceHack AceHack merged commit 743fbe8 into main May 13, 2026
28 of 29 checks passed
@AceHack AceHack deleted the fix-lint-ts2345-standing-by-detector-2026-05-13 branch May 13, 2026 18:31
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.

2 participants