chore(lint): enforce eslint/no-unsafe-optional-chaining#25106

merged2
lint-rules/eslint-no-unneeded-ternary
lint-rules/eslint-no-unsafe-optional-chaining
opened1d agobyJJulius Marminge
View on GitHubTwo-way sync enabledPR last imported 1d ago

Promote eslint/no-unsafe-optional-chaining to an error. Establish the optional value before using it in a non-optional operation.

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

Validation: the original full stack passed its local checks. This rule is now in the mechanical landing batch ahead of held changes; updated batch checks and CI are running.

Model: GPT-6.1 Sol. Harness: Codex.

Checks

24 successful · 12 skipped
All checks passed
9aaad08
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: 9aaad08 · 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 9aaad08

Macroscope's review found this PR approvable — The PR only tightens lint diagnostics and refactors a test assertion; it does not alter production behavior or product defaults. The new rule is an enforcement addition, not a lint suppression.

Notes:

  • Diff unchanged. Approvability was decided on eligibility alone.

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

Added 2 commits

  • chore(lint): enforce eslint/no-unneeded-ternarya01656c
  • chore(lint): enforce eslint/no-unsafe-optional-chaining9aaad08
Synced from GitHub

Review in Change Stack →

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 a01656c4a2d93f0b14a00ffc6a326293c03ad743 and 9aaad08fc43af49127738cc308c1d46109955968.

External image Files selected for processing: 2
  • apps/server/src/orchestration-v2/ThreadLaunchService.test.ts
  • vite.config.ts

Limit details: You’ve used all 10 included reviews currently available.

Walkthrough

The attachment-intake test now checks that its first context record is defined before comparing attachment IDs. The lint configuration now treats unsafe optional chaining as an error.

Changes: Optional-chaining checks

Layer / File(s)Summary
Test assertion and lint rule
apps/server/src/orchestration-v2/ThreadLaunchService.test.ts, vite.config.ts
The test checks that the first context record is defined before comparing its attachmentId. The lint configuration treats eslint/no-unsafe-optional-chaining violations as errors.

Priority: External image Low

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Other

Suggested reviewers: maria-rcks

Merge Risk: External image Minimal · up to 9aaad

The lint-rule promotion and test update are safe to merge.

Pre-merge checks: Passed 4
Check nameStatusExplanation
Title checkPassedThe title clearly and concisely identifies the main change: enforcing eslint/no-unsafe-optional-chaining.
Description checkPassedThe description explains the problem, the rule and call-site changes, the focused scope, and the current verification status. It also identifies pending batch checks and CI, so it does not claim unver…
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, the rule and call-site changes, the focused scope, and the current verification status. It also identifies pending batch checks and CI, so it does not claim unverified results as complete.

Finishing Touches: 💡 1
🛠️ Fix failing CI checks: 💡
  • Commit to this branch
  • Create a new PR
📝 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.