chore: Duplicate RARITY_COLORS constants with different values #36
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/constants/core.ts(lines 11-19) —RARITY_COLORSwithlegendary: '#F97316'src/lib/game/data/loot-drops.ts(lines 155-163) —RARITY_COLORSwithlegendary: '#F59E0B'and extraglowpropertyProblem: Two different
RARITY_COLORSconstants with different structures and values exist. The loot-drops version has an extraglowfield and a different color for legendary items. These serve different purposes but the naming collision is confusing.Impact: Inconsistent rarity colors across the UI. Developers may import from the wrong file.
Fix: Rename one of them (e.g.,
RARITY_COLORSin loot-drops.ts →LOOT_RARITY_COLORS) or consolidate into a single shared constant.[priority: 3] DATA/LOGIC BUG — Duplicate RARITY_COLORS constants with different values.
Starting work on #36. Will rename duplicate RARITY_COLORS in loot-drops.ts to LOOT_RARITY_COLORS.
Fixed. Renamed RARITY_COLORS in loot-drops.ts to LOOT_RARITY_COLORS to avoid naming collision with the RARITY_COLORS in constants/core.ts. Updated all consumers (EquipmentCrafter.tsx, LootInventory/index.tsx, LootInventory/types.ts) to use the renamed export.