chore: promote no-case-declarations lint to an error #1006
@ -23,7 +23,7 @@
 | 
				
			|||||||
        "@typescript-eslint/no-explicit-any": "warn",
 | 
					        "@typescript-eslint/no-explicit-any": "warn",
 | 
				
			||||||
        "@typescript-eslint/no-loss-of-precision": "warn",
 | 
					        "@typescript-eslint/no-loss-of-precision": "warn",
 | 
				
			||||||
        "@typescript-eslint/no-unnecessary-condition": "warn",
 | 
					        "@typescript-eslint/no-unnecessary-condition": "warn",
 | 
				
			||||||
        "no-case-declarations": "warn",
 | 
					        "no-case-declarations": "error",
 | 
				
			||||||
        "prettier/prettier": "error",
 | 
					        "prettier/prettier": "error",
 | 
				
			||||||
        "@typescript-eslint/semi": "error",
 | 
					        "@typescript-eslint/semi": "error",
 | 
				
			||||||
        "no-mixed-spaces-and-tabs": "error",
 | 
					        "no-mixed-spaces-and-tabs": "error",
 | 
				
			||||||
 | 
				
			|||||||
@ -404,18 +404,21 @@ export const addItem = async (
 | 
				
			|||||||
            switch (typeName.substr(1).split("/")[2]) {
 | 
					            switch (typeName.substr(1).split("/")[2]) {
 | 
				
			||||||
                case "Mods": // Legendary Core
 | 
					                case "Mods": // Legendary Core
 | 
				
			||||||
                case "CosmeticEnhancers": // Traumatic Peculiar
 | 
					                case "CosmeticEnhancers": // Traumatic Peculiar
 | 
				
			||||||
                    const changes = [
 | 
					                    {
 | 
				
			||||||
                        {
 | 
					                        const changes = [
 | 
				
			||||||
                            ItemType: typeName,
 | 
					                            {
 | 
				
			||||||
                            ItemCount: quantity
 | 
					                                ItemType: typeName,
 | 
				
			||||||
                        }
 | 
					                                ItemCount: quantity
 | 
				
			||||||
                    ];
 | 
					                            }
 | 
				
			||||||
                    addMods(inventory, changes);
 | 
					                        ];
 | 
				
			||||||
                    return {
 | 
					                        addMods(inventory, changes);
 | 
				
			||||||
                        InventoryChanges: {
 | 
					                        return {
 | 
				
			||||||
                            RawUpgrades: changes
 | 
					                            InventoryChanges: {
 | 
				
			||||||
                        }
 | 
					                                RawUpgrades: changes
 | 
				
			||||||
                    };
 | 
					                            }
 | 
				
			||||||
 | 
					                        };
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    break;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            break;
 | 
					            break;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
				
			|||||||
@ -208,14 +208,14 @@ export const addMissionInventoryUpdates = (
 | 
				
			|||||||
                inventory.CompletedSorties.push(value);
 | 
					                inventory.CompletedSorties.push(value);
 | 
				
			||||||
                break;
 | 
					                break;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            case "SeasonChallengeCompletions":
 | 
					            case "SeasonChallengeCompletions": {
 | 
				
			||||||
                const processedCompletions = value.map(({ challenge, id }) => ({
 | 
					                const processedCompletions = value.map(({ challenge, id }) => ({
 | 
				
			||||||
                    challenge: challenge.substring(challenge.lastIndexOf("/") + 1),
 | 
					                    challenge: challenge.substring(challenge.lastIndexOf("/") + 1),
 | 
				
			||||||
                    id
 | 
					                    id
 | 
				
			||||||
                }));
 | 
					                }));
 | 
				
			||||||
 | 
					 | 
				
			||||||
                inventory.SeasonChallengeHistory.push(...processedCompletions);
 | 
					                inventory.SeasonChallengeHistory.push(...processedCompletions);
 | 
				
			||||||
                break;
 | 
					                break;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
            default:
 | 
					            default:
 | 
				
			||||||
                // Equipment XP updates
 | 
					                // Equipment XP updates
 | 
				
			||||||
                if (equipmentKeys.includes(key as TEquipmentKey)) {
 | 
					                if (equipmentKeys.includes(key as TEquipmentKey)) {
 | 
				
			||||||
 | 
				
			|||||||
@ -105,7 +105,7 @@ export const updateStats = async (playerStats: TStatsDatabaseDocument, payload:
 | 
				
			|||||||
                        case "FIRE_WEAPON":
 | 
					                        case "FIRE_WEAPON":
 | 
				
			||||||
                        case "HIT_ENTITY_ITEM":
 | 
					                        case "HIT_ENTITY_ITEM":
 | 
				
			||||||
                        case "HEADSHOT_ITEM":
 | 
					                        case "HEADSHOT_ITEM":
 | 
				
			||||||
                        case "KILL_ENEMY_ITEM":
 | 
					                        case "KILL_ENEMY_ITEM": {
 | 
				
			||||||
                            playerStats.Weapons ??= [];
 | 
					                            playerStats.Weapons ??= [];
 | 
				
			||||||
                            const statKey = {
 | 
					                            const statKey = {
 | 
				
			||||||
                                FIRE_WEAPON: "fired",
 | 
					                                FIRE_WEAPON: "fired",
 | 
				
			||||||
@ -126,10 +126,11 @@ export const updateStats = async (playerStats: TStatsDatabaseDocument, payload:
 | 
				
			|||||||
                                }
 | 
					                                }
 | 
				
			||||||
                            }
 | 
					                            }
 | 
				
			||||||
                            break;
 | 
					                            break;
 | 
				
			||||||
 | 
					                        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                        case "KILL_ENEMY":
 | 
					                        case "KILL_ENEMY":
 | 
				
			||||||
                        case "EXECUTE_ENEMY":
 | 
					                        case "EXECUTE_ENEMY":
 | 
				
			||||||
                        case "HEADSHOT":
 | 
					                        case "HEADSHOT": {
 | 
				
			||||||
                            playerStats.Enemies ??= [];
 | 
					                            playerStats.Enemies ??= [];
 | 
				
			||||||
                            const enemyStatKey = {
 | 
					                            const enemyStatKey = {
 | 
				
			||||||
                                KILL_ENEMY: "kills",
 | 
					                                KILL_ENEMY: "kills",
 | 
				
			||||||
@ -149,6 +150,7 @@ export const updateStats = async (playerStats: TStatsDatabaseDocument, payload:
 | 
				
			|||||||
                                }
 | 
					                                }
 | 
				
			||||||
                            }
 | 
					                            }
 | 
				
			||||||
                            break;
 | 
					                            break;
 | 
				
			||||||
 | 
					                        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                        case "DIE":
 | 
					                        case "DIE":
 | 
				
			||||||
                            playerStats.Enemies ??= [];
 | 
					                            playerStats.Enemies ??= [];
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user