chore(lint): enforce unicorn/no-useless-fallback-in-spread#25103

merged2
lint-rules/unicorn-require-module-specifiers
lint-rules/unicorn-no-useless-fallback-in-spread
opened1d agobyJJulius Marminge
View on GitHubTwo-way sync enabledPR last imported 1d ago

Promote unicorn/no-useless-fallback-in-spread to an error. Remove object-spread fallbacks that are redundant for nullish values.

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

1 failing · 24 successful · 13 skipped
Some checks failed

Failing1

135a734
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: 135a734 · 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 dbb9d69

Macroscope's review found this PR approvable — This PR enables a lint rule and removes redundant nullish fallbacks in three production expressions and one test expression. Nullish operands are already ignored by object spread, so the edits do not change runtime behavior or product defaults.

No code changes detected at 135a734. Prior analysis still applies.

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

Added 2 commits

  • chore(lint): enforce unicorn/require-module-specifiersc7a75f4
  • chore(lint): enforce unicorn/no-useless-fallback-in-spread135a734
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 c7a75f4a4196ab24dba910ae7616cc28d47ae07f and 135a7340fc659ad0b026e2d2db05ab0600d8d928.

External image Files selected for processing: 5
  • apps/mobile/src/state/use-composer-drafts.ts
  • apps/mobile/src/state/use-model-option-memory.ts
  • packages/shared/src/serverSettings.ts
  • scripts/lib/cli-external-packages.test.ts
  • vite.config.ts

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

Walkthrough

The lint configuration now treats unicorn/no-useless-fallback-in-spread as an error. Spreads in mobile state, shared server settings, and a dependency-closure test no longer use empty-object fallbacks.

Changes: Spread fallback cleanup

Layer / File(s)Summary
Configure and apply spread fallback rule
vite.config.ts, apps/mobile/src/state/use-composer-drafts.ts, apps/mobile/src/state/use-model-option-memory.ts, packages/shared/src/serverSettings.ts, scripts/lib/cli-external-packages.test.ts
The lint configuration enables unicorn/no-useless-fallback-in-spread as an error. The affected spreads remove their empty-object fallbacks. The test still combines the three dependency maps.

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 135a7

The lint-only cleanup does not introduce an actionable runtime or compatibility risk.

Pre-merge checks: Passed 3 · Failed 1

Failed Failed checks: 1 warning

Check nameStatusExplanationResolution
Description checkWarningThe description gives a short summary and states the scope (only this rule and its call sites). It also has a validation note and a model/harness line. It does not follow the required template: the Pr…Rewrite the description to follow the repository template with these sections:
1. Problem: state that the rule is not enforced and that redundant object-spread fallbacks exist for nullish values. Name the affected files.
2. Change: explain …
Passed Passed checks: 3 passed
Check nameStatusExplanation
Title checkPassedThe title "chore(lint): enforce unicorn/no-useless-fallback-in-spread" names the single change in the changeset: the lint rule is promoted to an error and the redundant object-spread fallbacks are rem…
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 unicorn/no-useless-fallback-in-spread" names the single change in the changeset: the lint rule is promoted to an error and the redundant object-spread fallbacks are removed. It follows conventional commit style and is specific enough for a teammate scanning history.

Full details: Description check

Explanation

The description gives a short summary and states the scope (only this rule and its call sites). It also has a validation note and a model/harness line. It does not follow the required template: the Problem, Change, Scope and approval, and Verification sections are missing. There is no linked issue or maintainer approval, and no focused verification of the changed behavior is described. The Scope and approval section is required for this kind of change, so the description is largely incomplete.

Resolution

Rewrite the description to follow the repository template with these sections:

  1. Problem: state that the rule is not enforced and that redundant object-spread fallbacks exist for nullish values. Name the affected files.
  2. Change: explain that the rule is set to error in vite.config.ts and that the fallbacks are removed in the four listed files. Explain why each removal does not change behavior.
  3. Scope and approval: link the triaged issue or the discussion with maintainer approval. If none exists, explain why this small lint-only change qualifies without prior approval. Also state that it is one layer of a stack, and link the related PRs if they exist.
  4. Verification: list the focused tests or checks run for the changed files and their observed results. State that the final local test rerun and CI are pending. Do not rely on 'tests pass' alone. Remove the vague statement about the 'mechanical landing batch' or explain it clearly. Keep the model and harness line at the end, as the template requests.
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.