Skip to content

refactor(hooks): use an explicit react/purity disable instead of a Date helper - #375

Merged
finallyjay merged 1 commit into
mainfrom
refactor/purity-disable-directive
Oct 8, 2026
Merged

finallyjay merged 1 commit into
mainfrom
refactor/purity-disable-directive

Conversation

@finallyjay

Copy link
Copy Markdown
Owner

Summary

#373 silenced the oxlint 1.86 react(purity) error in useSteamAchievementsBatch by moving new Date() into a module-level currentTimestamp() helper. That only hides the call from the rule — the clock is still read during render.

This replaces the helper with an explicit // oxlint-disable-next-line react/purity plus a rationale at the call site, so the intentional exception is visible and greppable. Same pattern as the other repos.

No behaviour change.

Verification

  • pnpm lint (oxlint + typecheck): pass
  • pnpm format:check: pass
  • pnpm test: 74 files, 745 tests passed
  • Removing the directive makes oxlint report react(purity) at hooks/use-steam-data.ts:62, so the directive is required (not dead).

🤖 Generated with Claude Code

…te helper

Replace the module-level currentTimestamp() helper, which only routed
around the react(purity) rule, with an oxlint-disable-next-line
directive and rationale at the render-phase call site. Matches the
pattern used in personal-deck. No behaviour change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@finallyjay
finallyjay enabled auto-merge (squash) October 8, 2026 15:19
@coderabbitai

coderabbitai Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: bd9896b0-8225-424c-951f-8c945328425e
📥 Commits

Reviewing files that changed from the base of the PR and between f965e90 and 3204b55.

📒 Files selected for processing (1)
  • hooks/use-steam-data.ts

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

📜 Recent review details
⏰ Context from checks skipped due to timeout. (3)
  • GitHub Check: quality
  • GitHub Check: Analyze (actions)
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (1)
hooks/use-steam-data.ts (1)

59-62: LGTM!


📝 Summary

Summary by CodeRabbit

  • Bug Fixes
    • Updated the last-updated time when the app-ID list becomes empty after an app-ID change.

Walkthrough

When the normalized app-ID list is empty after an app-ID-key change, useSteamAchievementsBatch now sets lastUpdated with new Date(). The unused currentTimestamp helper and its explanatory comments are removed.

Changes

Steam data timestamp update

Layer / File(s) Summary
Set timestamp for empty app-ID list
hooks/use-steam-data.ts
The empty-list branch sets lastUpdated directly with new Date(). The currentTimestamp helper and its explanatory comments are removed.

Priority: ⬇️ Low

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

Change: Refactor

Merge Risk: ⚪ Minimal · up to 3204b

No actionable merge-blocking risk is established by the described change; it can proceed through normal checks.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: replacing the timestamp helper with an explicit React purity suppression directive.
Description check ✅ Passed The description directly explains the refactor, its rationale, expected behavior, and verification results.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

A rabbit checks the ticking clock
And sees a fresh new date appear
The helper hops out of the code
The empty list is handled clear
Then off the rabbit bounds, content

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

@finallyjay
finallyjay merged commit 37e688d into main Oct 8, 2026
6 checks passed
@finallyjay
finallyjay deleted the refactor/purity-disable-directive branch October 8, 2026 15:22
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.

1 participant