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