chore(lint): enforce react/no-array-index-key#25112

merged1
lint-rules/react-no-unstable-nested-components
lint-rules/react-no-array-index-key
opened5d agobyJJulius Marminge
View on GitHubTwo-way sync enabledPR last imported 4d ago

Promote react/no-array-index-key to an error. Reject index keys by default. Document stateless snapshot positions and repeated decorative entries where positional identity is intentional.

This PR changes only this rule and its existing call sites. Each changed rule has its own PR.

Stack validation: rebased onto b76a110. The earlier 234-file test run passed, and the cancellation regression test passes after its local exception. Rebased format, lint, Knip, and all 34 affected-package typecheck tasks pass. The final local test rerun and fresh CI are pending.

Model: GPT-6.1 Sol. Harness: Codex.

Checks

23 successful · 14 skipped
All checks passed
722cf84
Synced from GitHub

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

ℹ️ No successful main baseline artifact is available yet. This run establishes the initial measurement.

ProviderMetricMain baselineThis PRImpactPR ceiling
CodexTotal thread wire—5.0 KiB—6.8 KiB✅
CodexThread snapshot wire—3.8 KiB—4.9 KiB✅
CodexLive turn WebSocket wire—1.2 KiB—2.0 KiB✅
CodexLive turn WebSocket decoded—20.9 KiB—29.3 KiB✅
CodexLive turn messages—2—8✅
ClaudeTotal thread wire—5.0 KiB—6.8 KiB✅
ClaudeThread snapshot wire—3.8 KiB—4.9 KiB✅
ClaudeLive turn WebSocket wire—1.2 KiB—2.0 KiB✅
ClaudeLive turn WebSocket decoded—21.2 KiB—29.3 KiB✅
ClaudeLive turn messages—2—8✅

Baseline: unavailable · PR result: 722cf84 · Source CI: success

Scenario and decoded snapshot size

10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

  • Codex decoded thread snapshot: 108.5 KiB
  • Claude decoded thread snapshot: 108.8 KiB

Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

Synced from GitHub

Approvability

Verdict: Needs Human Approval

Macroscope's review found this PR requires human approval — This PR enables react/no-array-index-key enforcement and adds scoped oxlint suppressions for existing cases across mobile and web code. The added static-analysis overrides require human review under the repository's review policy.

Notes:

  • Diff unchanged. Approvability was decided on eligibility alone.

No code changes detected at 722cf84. Prior analysis still applies.

You can add or adjust custom eligibility rules. Learn more.

Synced from GitHub

Review in Change Stack →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

External image Run configuration
External image Commits

Reviewing files that changed from the base of the PR and between 4084cebd2b5c33be1505ee33981f83bdba2a05d6 and 722cf841f52cdaf58564e9aacb55456c7f985ba8.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

No actionable comments were generated in the recent review.

External image Recent review info
External image Run configuration
External image Commits

Reviewing files that changed from the base of the PR and between a9cf5c5e46b68bd628b8336dcb62ca4937c396ce and 4084cebd2b5c33be1505ee33981f83bdba2a05d6.

External image Files selected for processing: 10
  • apps/mobile/modules/t3-source-text/src/SourceText.tsx
  • apps/mobile/src/components/ComposerContextSheet.tsx
  • apps/mobile/src/features/files/SourceFileSurface.tsx
  • apps/mobile/src/features/review/ReviewCommentCard.tsx
  • apps/mobile/src/features/terminal/TerminalContextSheet.tsx
  • apps/mobile/src/features/threads/thread-list-v2-items.tsx
  • apps/mobile/src/features/threads/thread-work-log.tsx
  • apps/web/src/components/pullRequest/PullRequestChecksPopover.tsx
  • apps/web/src/components/pullRequest/PullRequestSummaryTab.tsx
  • vite.config.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.

Walkthrough

The Vite lint configuration now treats react/no-array-index-key violations as errors. Existing mobile and web mappings add scoped suppressions or formatting updates. The rendered content and keys remain unchanged.

Changes: Array-index key lint enforcement

Layer / File(s)Summary
Enable the lint rule
vite.config.ts
The Vite lint configuration sets react/no-array-index-key to error severity.
Scope suppressions around existing mappings
apps/mobile/modules/t3-source-text/src/SourceText.tsx, apps/mobile/src/components/ComposerContextSheet.tsx, apps/mobile/src/features/files/SourceFileSurface.tsx, apps/mobile/src/features/review/ReviewCommentCard.tsx, apps/mobile/src/features/terminal/TerminalContextSheet.tsx, apps/mobile/src/features/threads/thread-list-v2-items.tsx, apps/mobile/src/features/threads/thread-work-log.tsx, apps/web/src/components/pullRequest/PullRequestChecksPopover.tsx, apps/web/src/components/pullRequest/PullRequestSummaryTab.tsx
Mobile and web mapping callbacks receive scoped lint suppressions or formatting changes. Their rendering behavior and keys remain unchanged.

Priority: External image Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other

Suggested reviewers: maria-rcks

Merge Risk: External image Minimal · up to 4084c

No actionable runtime or compatibility risk was identified; the PR is mergeable after normal checks.

Pre-merge checks: Passed 4
Check nameStatusExplanation
Title checkPassedThe title clearly identifies the main change: enforcing react/no-array-index-key as a lint error.
Description checkPassedThe description explains the problem, change scope, affected rule, validation results, pending checks, and agent attribution. It does not use the template headings or provide an explicit issue or main…
Linked Issues checkPassedCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes checkPassedCheck skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description explains the problem, change scope, affected rule, validation results, pending checks, and agent attribution. It does not use the template headings or provide an explicit issue or maintainer approval link, but the focused configuration change and its rationale are sufficiently described.

Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

Added 1 commit

  • chore(lint): enforce react/no-array-index-key722cf84