chore(lint): enforce react/immutability#25115

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

Promote react/immutability to an error. Update Reanimated shared values through .set instead of assigning .value during callbacks.

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 · 13 skipped
All checks passed
7a24725
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: 7a24725 · 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: Approved at b02fc26

Macroscope's review found this PR approvable — This is a focused React Native Reanimated API migration that preserves existing animation targets, timings, and value updates while satisfying the newly enforced immutability lint rule. The remaining test and lint configuration changes affect validation tooling only, with no product-default or other material runtime changes.

No code changes detected at 7a24725. 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 b02fc2638fec94e2f78c2cfa494931901003a3a8 and 7a2472545e3a05795367d82636ae9705d44be05c.

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 4084cebd2b5c33be1505ee33981f83bdba2a05d6 and b02fc2638fec94e2f78c2cfa494931901003a3a8.

External image Files selected for processing: 11
  • apps/mobile/src/features/layout/workspace-inspector-pane.tsx
  • apps/mobile/src/features/threads/PendingUserInputCard.tsx
  • apps/mobile/src/features/threads/ThreadComposer.tsx
  • apps/mobile/src/features/threads/ThreadDetailScreen.tsx
  • apps/mobile/src/features/threads/floating-working-control.tsx
  • apps/mobile/src/features/threads/thread-work-log.tsx
  • apps/mobile/src/features/voice-input/ComposerDictationControl.tsx
  • apps/mobile/src/features/voice-input/GlobalVoiceInputControl.tsx
  • apps/mobile/src/features/voice-input/VoiceInputProvider.tsx
  • apps/mobile/src/reactCompilerCoverage.test.ts
  • vite.config.ts
External image Files with no reviewable changes: 1
  • apps/mobile/src/reactCompilerCoverage.test.ts

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

Walkthrough

Mobile animation and layout code now updates Reanimated shared values through .set(...) instead of .value assignments. The compiler coverage test no longer lists PendingUserInputCard as a known bailout, and the Vite+ lint configuration treats react/immutability violations as errors.

Changes: Mobile shared-value updates

Layer / File(s)Summary
Shared-value updates and checks
apps/mobile/src/features/layout/workspace-inspector-pane.tsx, apps/mobile/src/features/threads/*, apps/mobile/src/features/voice-input/*, apps/mobile/src/reactCompilerCoverage.test.ts, vite.config.ts
Mobile animation and layout code now uses .set(...) for shared-value updates. The coverage test no longer expects a compiler bailout for PendingUserInputCard, and the lint configuration sets react/immutability to error.

Priority: External image Low

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

Suggested reviewers: maria-rcks

Merge Risk: External image Minimal · up to b02fc

The lint-rule update is mergeable; the reviewed call-site changes preserve existing animation and layout behavior.

Pre-merge checks: Passed 3 · Failed 1

Failed Failed checks: 1 warning

Check nameStatusExplanationResolution
Description checkWarningThe description states the purpose: promoting react/immutability to an error and switching Reanimated shared value updates from .value assignments to .set(). It names the scope limit, the rebase targe…Restructure the description to follow the template. Add a Problem section that explains why immutability violations need to be errors and what breaks or misbehaves today. Add a Change section that explains the switch to .set() and the vite.…
Passed Passed checks: 3 passed
Check nameStatusExplanation
Title checkPassedThe title "chore(lint): enforce react/immutability" matches the main change. The PR promotes react/immutability to an error in vite.config.ts and updates Reanimated shared values to use .set() across …
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: Title check

Explanation

The title "chore(lint): enforce react/immutability" matches the main change. The PR promotes react/immutability to an error in vite.config.ts and updates Reanimated shared values to use .set() across the mobile app call sites. It follows conventional commit form and names the rule, so a teammate scanning history can identify the primary change.

Full details: Description check

Explanation

The description states the purpose: promoting react/immutability to an error and switching Reanimated shared value updates from .value assignments to .set(). It names the scope limit, the rebase target, and the local checks that passed. It has no Problem, Change, Scope and approval, or Verification headings from the repository template. It gives no link to a triaged issue or maintainer approval, and it gives no explanation of why the change qualifies without one. The verification text reports some local checks but says the final test rerun and CI are pending, and it does not describe the cancellation regression test exception. The model and harness line is present.

Resolution

Restructure the description to follow the template. Add a Problem section that explains why immutability violations need to be errors and what breaks or misbehaves today. Add a Change section that explains the switch to .set() and the vite.config.ts rule change. Add a Scope and approval section that links the triaged issue or maintainer discussion, or explains why this small lint enforcement qualifies without prior approval. Add a Verification section that lists the focused tests run, the cancellation regression test exception and its reason, and the pending final test rerun and CI status. Keep the model and harness line at the end.

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/immutability7a24725