fix: RoomType type defined in two places #39

Closed
opened 2026-05-18 15:59:27 +02:00 by Anexim · 3 comments
Owner

Severity: Major

Files:

  • src/lib/game/types/game.ts (line 37) — export type RoomType = 'combat' | 'puzzle' | 'swarm' | 'speed' | 'guardian'
  • src/lib/game/constants/rooms.ts (line 4) — identical export type RoomType = 'combat' | 'puzzle' | 'swarm' | 'speed' | 'guardian'

Problem: Identical RoomType type defined in both types/game.ts and constants/rooms.ts. The constants/index.ts re-exports from ./rooms, while types/index.ts re-exports from ./game. This creates ambiguity about which is canonical.

Impact: Potential for type divergence if one is updated without the other. Confusing for developers.

Fix: Remove the duplicate from constants/rooms.ts and import from types/game.ts, or vice versa.

**Severity:** Major **Files:** - `src/lib/game/types/game.ts` (line 37) — `export type RoomType = 'combat' | 'puzzle' | 'swarm' | 'speed' | 'guardian'` - `src/lib/game/constants/rooms.ts` (line 4) — identical `export type RoomType = 'combat' | 'puzzle' | 'swarm' | 'speed' | 'guardian'` **Problem:** Identical `RoomType` type defined in both `types/game.ts` and `constants/rooms.ts`. The `constants/index.ts` re-exports from `./rooms`, while `types/index.ts` re-exports from `./game`. This creates ambiguity about which is canonical. **Impact:** Potential for type divergence if one is updated without the other. Confusing for developers. **Fix:** Remove the duplicate from `constants/rooms.ts` and import from `types/game.ts`, or vice versa.
Anexim added the ai:todo label 2026-05-18 15:59:27 +02:00
n8n-gitea was assigned by Anexim 2026-05-18 15:59:27 +02:00
Author
Owner

[priority: 3] DATA/LOGIC BUG — RoomType type defined in two places.

[priority: 3] DATA/LOGIC BUG — RoomType type defined in two places.
Author
Owner

Starting work on #39. Will remove duplicate RoomType from constants/rooms.ts and import from types/game.ts.

Starting work on #39. Will remove duplicate RoomType from constants/rooms.ts and import from types/game.ts.
Author
Owner

Fixed. Removed duplicate RoomType from constants/rooms.ts and changed it to re-export from types/game.ts. Updated constants/index.ts to re-export RoomType from types/game.ts instead of from rooms.ts.

Fixed. Removed duplicate RoomType from constants/rooms.ts and changed it to re-export from types/game.ts. Updated constants/index.ts to re-export RoomType from types/game.ts instead of from rooms.ts.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Anexim/Mana-Loop#39