fix: RoomType type defined in two places #39
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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) — identicalexport type RoomType = 'combat' | 'puzzle' | 'swarm' | 'speed' | 'guardian'Problem: Identical
RoomTypetype defined in bothtypes/game.tsandconstants/rooms.ts. Theconstants/index.tsre-exports from./rooms, whiletypes/index.tsre-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.tsand import fromtypes/game.ts, or vice versa.[priority: 3] DATA/LOGIC BUG — RoomType type defined in two places.
Starting work on #39. Will remove duplicate RoomType from constants/rooms.ts and import from types/game.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.