desloppify: fix 34 unused imports/vars, debug logs, and code quality issues
Build and Publish Mana Loop Docker Image / build-and-publish (push) Successful in 2m20s

This commit is contained in:
2026-05-26 02:35:02 +02:00
parent fdc636faaa
commit 518961299a
23 changed files with 30 additions and 43 deletions
+2 -2
View File
@@ -1,8 +1,8 @@
# Circular Dependencies
Generated: 2026-05-25T18:18:45.184Z
Generated: 2026-05-25T18:44:15.053Z
Found: 6 circular chain(s) — these MUST be fixed before modifying involved files.
1. Processed 135 files (1.6s) (2 warnings)
1. Processed 135 files (1.7s) (2 warnings)
2. 1) utils/floor-utils.ts > utils/room-utils.ts > utils/enemy-utils.ts
3. 2) utils/floor-utils.ts > utils/room-utils.ts
4. 3) stores/gameStore.ts > stores/gameActions.ts
+1 -1
View File
@@ -1,6 +1,6 @@
{
"_meta": {
"generated": "2026-05-25T18:18:43.369Z",
"generated": "2026-05-25T18:44:13.132Z",
"description": "Import dependency graph for src/lib/game. Keys are files, values are arrays of files they import.",
"usage": "To find what a file affects, search for its path in the VALUES. To find what a file depends on, look at its KEY entry."
},
BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 84 KiB

After

Width:  |  Height:  |  Size: 84 KiB

+1 -1
View File
@@ -9,7 +9,7 @@ import type { SpellDef } from '@/lib/game/types';
export function GrimoireTab() {
const [grimoireSpells, setGrimoireSpells] = useState<[string, SpellDef][]>([]);
const [loaded, setLoaded] = useState(false);
const [loaded, _setLoaded] = useState(false);
useEffect(() => {
if (typeof window !== 'undefined' && SPELLS_DEF) {
@@ -109,7 +109,7 @@ export function EnchantmentApplier({
</div>
<ScrollArea className="h-32">
<div className="space-y-1">
{equippedItems.map(({ slot, instance }) => (
{equippedItems.map(({ slot: _slot, instance }) => (
<div
key={instance.instanceId}
className={`p-2 rounded border cursor-pointer text-sm transition-all
@@ -12,7 +12,6 @@ export function DesignForm({
selectedEquipmentCapacity,
isOverCapacity,
designTime,
selectedEquipmentType,
handleCreateDesign,
}: DesignFormProps) {
return (
@@ -12,7 +12,6 @@ import type { EffectSelectorProps } from './types';
export function EffectSelector({
selectedEquipmentType,
selectedEffects,
setSelectedEffects,
availableEffects,
incompatibleEffects,
enchantingLevel,
@@ -53,7 +52,7 @@ export function EffectSelector({
{/* Compatible Effects */}
{availableEffects.map(effect => {
const selected = selectedEffects.find(e => e.effectId === effect.id);
const cost = calculateEffectCapacityCost(effect.id, (selected?.stacks || 0) + 1, efficiencyBonus);
const _cost = calculateEffectCapacityCost(effect.id, (selected?.stacks || 0) + 1, efficiencyBonus);
return (
<div
+1 -1
View File
@@ -75,7 +75,7 @@ interface DisciplineCardProps {
const DisciplineCard: React.FC<DisciplineCardProps> = ({ definition, runtime, callbacks }) => {
const {
id, name, description, manaType, baseCost, perkThresholds, perkValues, perkTypes,
statBonus, statBonusLabel, baseValue, drainBase, difficultyFactor, scalingFactor,
statBonusLabel, baseValue, drainBase, difficultyFactor, scalingFactor,
} = definition;
const { xp, paused: isPaused, concurrentLimit, isLocked, missingPrereqs } = runtime;
const { onToggle } = callbacks;
+1 -1
View File
@@ -35,7 +35,7 @@ describe('Prestige upgrade definitions', () => {
it('all upgrades have required fields', async () => {
const { PRESTIGE_DEF } = await import('@/lib/game/constants/prestige');
for (const [id, def] of Object.entries(PRESTIGE_DEF)) {
for (const [, def] of Object.entries(PRESTIGE_DEF)) {
expect(def.name).toBeTruthy();
expect(def.desc).toBeTruthy();
expect(def.max).toBeGreaterThan(0);
@@ -71,7 +71,7 @@ function EnemyRow({ enemy }: { enemy: EnemyState }) {
);
}
export function RoomDisplay({ floorState, floor }: RoomDisplayProps) {
export function RoomDisplay({ floorState, _floor }: RoomDisplayProps) {
// Guard against null/undefined/stale floorState
if (!floorState || !floorState.roomType) {
return (
@@ -55,7 +55,6 @@ export function SpireCombatPage() {
floorHP,
floorMaxHP,
castProgress,
clearedFloors,
isDescending,
currentRoom,
activityLog,
@@ -73,7 +72,6 @@ export function SpireCombatPage() {
floorHP: s.floorHP,
floorMaxHP: s.floorMaxHP,
castProgress: s.castProgress,
clearedFloors: s.clearedFloors,
isDescending: s.isDescending,
currentRoom: s.currentRoom,
activityLog: s.activityLog,
@@ -314,12 +314,10 @@ export function SpireSummaryTab() {
const [mounted, setMounted] = useState(false);
const {
currentFloor,
maxFloorReached,
clearedFloors,
enterSpireMode,
} = useCombatStore(useShallow((s) => ({
currentFloor: s.currentFloor,
maxFloorReached: s.maxFloorReached,
clearedFloors: s.clearedFloors,
enterSpireMode: s.enterSpireMode,
@@ -83,10 +83,10 @@ describe('getFloorElement', () => {
it('should cycle through elements based on floor number', () => {
// Check that floors have different elements
const elem1 = getFloorElement(1);
const elem7 = getFloorElement(7);
const _elem1 = getFloorElement(1);
const _elem7 = getFloorElement(7);
// Since it cycles every 5 floors, floor 1 and 7 might have same element
const elem2 = getFloorElement(2);
const _elem2 = getFloorElement(2);
// Floor 1 and 2 should have different elements (if cycle allows)
});
});
+6 -6
View File
@@ -115,9 +115,9 @@ describe('computePactMultiplier', () => {
});
it('should handle three pacts with penalty', () => {
const floor10 = getGuardianForFloor(10)!;
const floor20 = getGuardianForFloor(20)!;
const floor30 = getGuardianForFloor(30)!;
const _floor10 = getGuardianForFloor(10)!;
const _floor20 = getGuardianForFloor(20)!;
const _floor30 = getGuardianForFloor(30)!;
// 3 pacts: numAdditional = 2, basePenalty = 1.0, effectivePenalty = 1.0
// result = baseMult * (1 - 1.0) = 0
@@ -225,9 +225,9 @@ describe('computePactInsightMultiplier', () => {
});
it('should handle three pacts with full penalty', () => {
const floor10 = getGuardianForFloor(10)!;
const floor20 = getGuardianForFloor(20)!;
const floor30 = getGuardianForFloor(30)!;
const _floor10 = getGuardianForFloor(10)!;
const _floor20 = getGuardianForFloor(20)!;
const _floor30 = getGuardianForFloor(30)!;
const result = computePactInsightMultiplier({
signedPacts: [10, 20, 30],
@@ -43,7 +43,7 @@ export function startCraftingEquipment(
}
export function cancelEquipmentCrafting(
get: () => CraftingState,
_get: () => CraftingState,
set: (fn: (state: CraftingState) => Partial<CraftingState>) => void
) {
set((state) => {
@@ -65,7 +65,7 @@ export function cancelEquipmentCrafting(
export function deleteMaterial(
materialId: string,
amount: number,
get: () => CraftingState,
_get: () => CraftingState,
set: (fn: (state: CraftingState) => Partial<CraftingState>) => void
) {
set((state) => {
+2 -2
View File
@@ -59,7 +59,7 @@ export interface CraftingInitResult {
export function initializeEquipmentCrafting(
blueprintId: string,
materials: Record<string, number>,
currentMana: number
_currentMana: number
): CraftingInitResult {
const recipe = CRAFTING_RECIPES[blueprintId];
@@ -149,7 +149,7 @@ export interface CraftingCancelResult {
logMessage: string;
}
export function cancelEquipmentCrafting(blueprintId: string, manaSpent: number): CraftingCancelResult {
export function cancelEquipmentCrafting(_blueprintId: string, manaSpent: number): CraftingCancelResult {
const recipe = CRAFTING_RECIPES[blueprintId];
if (!recipe) {
return {
+1 -1
View File
@@ -87,7 +87,7 @@ export function calculatePreparationTick(
// Apply preparation completion to equipment instance
export function completePreparation(
instance: EquipmentInstance,
manaSpent: number
_manaSpent: number
): {
updatedInstance: EquipmentInstance;
manaRecovered: number;
+1 -1
View File
@@ -83,7 +83,7 @@ export function getAttunementBySlot(slot: AttunementSlot): AttunementDef | undef
// Helper function to get all unlocked attunements for a player
export function getUnlockedAttunements(attunements: Record<string, { active: boolean; level: number; experience: number }>): AttunementDef[] {
return Object.entries(attunements)
.filter(([id, state]) => state.active)
.filter(([, state]) => state.active)
.map(([id]) => ATTUNEMENTS_DEF[id])
.filter(Boolean);
}
+1 -1
View File
@@ -100,7 +100,7 @@ export function computeDynamicClickMana(
export function computeDynamicDamage(
effects: ComputedEffects,
baseDamage: number,
floorHPPct: number,
_floorHPPct: number,
currentMana: number,
maxMana: number
): number {
+1 -1
View File
@@ -27,7 +27,7 @@ const initialState = {
export const useAttunementStore = create<AttunementStoreState>()(
persist(
(set, get) => ({
(set, _get) => ({
...initialState,
addAttunementXP: (attunementId: string, amount: number) => {
+1 -1
View File
@@ -49,7 +49,7 @@ export function processCombatTick(
set: (state: Partial<CombatState>) => void,
rawMana: number,
elements: Record<string, { current: number; max: number; unlocked: boolean }>,
maxMana: number,
_maxMana: number,
attackSpeedMult: number,
onFloorCleared: (floor: number, wasGuardian: boolean) => void,
onDamageDealt: (damage: number) => {
+3 -3
View File
@@ -277,9 +277,9 @@ export const useManaStore = create<ManaStore>()(
resetMana: (
prestigeUpgrades: Record<string, number>,
skills: Record<string, number> = {},
skillUpgrades: Record<string, string[]> = {},
skillTiers: Record<string, number> = {}
_skills: Record<string, number> = {},
_skillUpgrades: Record<string, string[]> = {},
_skillTiers: Record<string, number> = {}
) => {
const elementMax = 10 + (prestigeUpgrades.elemMax || 0) * 5;
const startingMana = 10 + (prestigeUpgrades.manaStart || 0) * 10;
-7
View File
@@ -18,7 +18,6 @@ export function createSafeStorage(): any {
if (str === null) return null;
return str;
} catch (error) {
console.warn(`[persist] Failed to read "${name}" from localStorage:`, error);
try {
localStorage.removeItem(name);
} catch {
@@ -31,18 +30,12 @@ export function createSafeStorage(): any {
try {
localStorage.setItem(name, JSON.stringify(value));
} catch (error) {
if (error instanceof DOMException && error.name === 'QuotaExceededError') {
console.warn(`[persist] localStorage quota exceeded for "${name}". State will not persist this tick.`);
} else {
console.warn(`[persist] Failed to write "${name}" to localStorage:`, error);
}
}
},
removeItem: (name: string): void => {
try {
localStorage.removeItem(name);
} catch (error) {
console.warn(`[persist] Failed to remove "${name}" from localStorage:`, error);
}
},
};