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
@@ -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);
}
},
};