chore: promote no-case-declarations lint to an error
All checks were successful
Build / build (18) (push) Successful in 1m5s
Build / build (20) (push) Successful in 1m3s
Build / build (22) (push) Successful in 1m3s
Build / build (18) (pull_request) Successful in 1m8s
Build / build (20) (pull_request) Successful in 1m4s
Build / build (22) (pull_request) Successful in 1m11s

This commit is contained in:
Sainan 2025-02-25 03:51:31 +01:00
parent 421164986a
commit abcff085ec
4 changed files with 22 additions and 17 deletions

View File

@ -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",

View File

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

View File

@ -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)) {

View File

@ -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 ??= [];