XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet

XFESpaceNinjaServer

A simple server for a small space ninja game

公开
关注 0 Fork 0 Star 0
返回提交历史

XFEstudio/XFESpaceNinjaServer

chore: promote no-case-declarations lint to an error (#1006)

Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/1006

38b255d4
Sainan <sainan@calamity.inc>
提交于

代码差异

4 个文件 +22 -17
Modified .eslintrc +1 -1
@@ -23,7 +23,7 @@
23 23 "@typescript-eslint/no-explicit-any": "warn",
24 24 "@typescript-eslint/no-loss-of-precision": "warn",
25 25 "@typescript-eslint/no-unnecessary-condition": "warn",
26 "no-case-declarations": "warn",
26 "no-case-declarations": "error",
27 27 "prettier/prettier": "error",
28 28 "@typescript-eslint/semi": "error",
29 29 "no-mixed-spaces-and-tabs": "error",
Modified src/services/inventoryService.ts +15 -12
@@ -404,18 +404,21 @@ export const addItem = async (
404 404 switch (typeName.substr(1).split("/")[2]) {
405 405 case "Mods": // Legendary Core
406 406 case "CosmeticEnhancers": // Traumatic Peculiar
407 const changes = [
408 {
409 ItemType: typeName,
410 ItemCount: quantity
411 }
412 ];
413 addMods(inventory, changes);
414 return {
415 InventoryChanges: {
416 RawUpgrades: changes
417 }
418 };
407 {
408 const changes = [
409 {
410 ItemType: typeName,
411 ItemCount: quantity
412 }
413 ];
414 addMods(inventory, changes);
415 return {
416 InventoryChanges: {
417 RawUpgrades: changes
418 }
419 };
420 }
421 break;
419 422 }
420 423 break;
421 424 }
Modified src/services/missionInventoryUpdateService.ts +2 -2
@@ -208,14 +208,14 @@ export const addMissionInventoryUpdates = (
208 208 inventory.CompletedSorties.push(value);
209 209 break;
210 210 }
211 case "SeasonChallengeCompletions":
211 case "SeasonChallengeCompletions": {
212 212 const processedCompletions = value.map(({ challenge, id }) => ({
213 213 challenge: challenge.substring(challenge.lastIndexOf("/") + 1),
214 214 id
215 215 }));
216
217 216 inventory.SeasonChallengeHistory.push(...processedCompletions);
218 217 break;
218 }
219 219 default:
220 220 // Equipment XP updates
221 221 if (equipmentKeys.includes(key as TEquipmentKey)) {
Modified src/services/statsService.ts +4 -2
@@ -105,7 +105,7 @@ export const updateStats = async (playerStats: TStatsDatabaseDocument, payload:
105 105 case "FIRE_WEAPON":
106 106 case "HIT_ENTITY_ITEM":
107 107 case "HEADSHOT_ITEM":
108 case "KILL_ENEMY_ITEM":
108 case "KILL_ENEMY_ITEM": {
109 109 playerStats.Weapons ??= [];
110 110 const statKey = {
111 111 FIRE_WEAPON: "fired",
@@ -126,10 +126,11 @@ export const updateStats = async (playerStats: TStatsDatabaseDocument, payload:
126 126 }
127 127 }
128 128 break;
129 }
129 130
130 131 case "KILL_ENEMY":
131 132 case "EXECUTE_ENEMY":
132 case "HEADSHOT":
133 case "HEADSHOT": {
133 134 playerStats.Enemies ??= [];
134 135 const enemyStatKey = {
135 136 KILL_ENEMY: "kills",
@@ -149,6 +150,7 @@ export const updateStats = async (playerStats: TStatsDatabaseDocument, payload:
149 150 }
150 151 }
151 152 break;
153 }
152 154
153 155 case "DIE":
154 156 playerStats.Enemies ??= [];