refactor: remove dead code and unused imports#664
refactor: remove dead code and unused imports#664kamilwronka wants to merge 1 commit intodevelopfrom
Conversation
- Remove unused `OtherMap` import from game.ts - Remove dead `timeDiff`, `hasSignificantDiff`, `remoteTimestamp`, `localTime` variables and unused `refetch` destructuring in use-timer-settings-sync.tsx (all were only used in commented-out conflict dialog code) - Prefix unused state setters with `_` to signal intentional non-use - Remove unused `generatePlayers` import from seed.ts Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
📝 WalkthroughWalkthroughThree files were cleaned up by removing unused imports and renaming state setters. In Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
apps/game-client/src/hooks/use-timer-settings-sync.tsx (1)
97-124: Consider removing or documenting the broken commented code.The commented conflict dialog code references variables that were removed (
hasSignificantDiffon line 101,remoteTimestampon line 103). If this feature might be re-enabled in the future, consider either:
- Adding a TODO comment listing the variables that need to be restored, or
- Removing the commented code entirely if the feature is permanently disabled
This would prevent confusion if someone attempts to uncomment and re-enable the conflict dialog.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@apps/game-client/src/hooks/use-timer-settings-sync.tsx` around lines 97 - 124, The commented-out conflict dialog block in use-timer-settings-sync.tsx references removed variables (hasSignificantDiff, remoteTimestamp, localTimestamp) and related setters (setLocalSnapshot, _setRemoteUpdatedAt, _setLocalUpdatedAt, setShowConflict, setIsInitialized); either delete the entire commented block if the dialog is permanently disabled, or replace it with a concise TODO that documents which variables and state-management pieces must be restored (list hasSignificantDiff, remoteTimestamp, localTimestamp, and the snapshot/setter functions) before re-enabling, so future developers know exactly what to reintroduce.apps/game-client/src/types/margonem/game.ts (1)
3-3: Useimport typefor type-only import.
OldOtherMapis only used in a type position (line 11), so it should be imported withimport typeto clarify that it's a type-only dependency.As per coding guidelines: Use
import typefor type-only imports.♻️ Proposed fix
-import { OldOtherMap } from "./others"; +import type { OldOtherMap } from "./others";🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@apps/game-client/src/types/margonem/game.ts` at line 3, OldOtherMap is only used as a type, so change its import to a type-only import: replace the value import of OldOtherMap with an import type for OldOtherMap (from the same "./others" module) so the compiler/runtime knows it is erased at emit; update the import line that currently reads importing OldOtherMap and make it an "import type" form to reflect its usage in the type declaration that references OldOtherMap.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@apps/game-client/src/hooks/use-timer-settings-sync.tsx`:
- Around line 97-124: The commented-out conflict dialog block in
use-timer-settings-sync.tsx references removed variables (hasSignificantDiff,
remoteTimestamp, localTimestamp) and related setters (setLocalSnapshot,
_setRemoteUpdatedAt, _setLocalUpdatedAt, setShowConflict, setIsInitialized);
either delete the entire commented block if the dialog is permanently disabled,
or replace it with a concise TODO that documents which variables and
state-management pieces must be restored (list hasSignificantDiff,
remoteTimestamp, localTimestamp, and the snapshot/setter functions) before
re-enabling, so future developers know exactly what to reintroduce.
In `@apps/game-client/src/types/margonem/game.ts`:
- Line 3: OldOtherMap is only used as a type, so change its import to a
type-only import: replace the value import of OldOtherMap with an import type
for OldOtherMap (from the same "./others" module) so the compiler/runtime knows
it is erased at emit; update the import line that currently reads importing
OldOtherMap and make it an "import type" form to reflect its usage in the type
declaration that references OldOtherMap.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 8ff861fb-5303-4570-aacb-28d57da3ee61
📒 Files selected for processing (3)
apps/game-client/src/hooks/use-timer-settings-sync.tsxapps/game-client/src/types/margonem/game.tspackages/cli/src/commands/seed/seed.ts
💤 Files with no reviewable changes (1)
- packages/cli/src/commands/seed/seed.ts
Summary
OtherMapimport fromapps/game-client/src/types/margonem/game.tstimeDiff,hasSignificantDiff,remoteTimestamp,localTime) and unusedrefetchdestructuring fromapps/game-client/src/hooks/use-timer-settings-sync.tsx— all were only referenced in commented-out conflict dialog code_setRemoteUpdatedAt,_setLocalUpdatedAt) with_to signal intentional non-usegeneratePlayersimport frompackages/cli/src/commands/seed/seed.tsWhy these are safe
Test plan
🤖 Generated with Claude Code
Summary by CodeRabbit