Skip to content

Commit 67a800c

Browse files
committed
fix: resolve 48 ESLint warnings (unused vars, dead code, stray any casts)
1 parent f0303bd commit 67a800c

5 files changed

Lines changed: 19 additions & 50 deletions

File tree

.eslintrc.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
{
88
"files": ["**/__tests__/**/*.ts", "**/*.test.ts", "**/*.spec.ts"],
99
"rules": {
10-
"@typescript-eslint/no-explicit-any": "off"
10+
"@typescript-eslint/no-explicit-any": "off",
11+
"@typescript-eslint/no-empty-function": "off"
1112
}
1213
}
1314
],

src/__tests__/multiplayer/DevvitQueue.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { jest, expect, describe, test, beforeEach } from '@jest/globals';
1+
import { expect, describe, test, beforeEach } from '@jest/globals';
22
import {
33
handleQueueJoin,
44
handleQueueStatus,

src/creature.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,7 @@ import { AugmentedMatrix } from './utility/matrices';
1313
import { Trap } from './utility/trap';
1414
import { HEX_WIDTH_PX, hashOffsetCoords, offsetNeighbors } from './utility/const';
1515
import { CreatureType, Level, Realm, Unit, UnitName } from './data/types';
16-
import {
17-
PlasmaField,
18-
detectWeakHardware,
19-
detectVeryWeakHardware,
20-
computePlasmaRenderScale,
21-
} from './plasma-field';
16+
import { PlasmaField, detectWeakHardware, detectVeryWeakHardware } from './plasma-field';
2217

2318
/** Vertical distance (in pixels) between the Dark Priest's feet and the Plasma Field center. */
2419
const PLASMA_FIELD_OFFSET_Y = 90;

src/devvit/headlessGame.ts

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -354,29 +354,6 @@ class SimSignal {
354354
}
355355
}
356356

357-
// ─── jQuery mock (chainable no-op) ───────────────────────────────────────────
358-
359-
function makeJQueryChain(): any {
360-
const chain: any = new Proxy(
361-
function _jq() {
362-
return chain;
363-
},
364-
{
365-
get(_target, prop) {
366-
if (prop === 'then' || prop === Symbol.toPrimitive) return undefined;
367-
if (prop === 'length') return 0;
368-
if (prop === 'width' || prop === 'height') return () => 1920;
369-
if (prop === 'offset') return () => ({ top: 0, left: 0 });
370-
return () => chain;
371-
},
372-
apply() {
373-
return chain;
374-
},
375-
},
376-
);
377-
return chain;
378-
}
379-
380357
// ─── Animations mock (completes movement synchronously) ─────────────────────
381358

382359
class MockAnimations {

src/game.ts

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ import type {
2525
LobbyState,
2626
} from './multiplayer';
2727
import type { AuthoritativeState, Intent } from './multiplayer/authoritative';
28-
import { getVisibilityAwareDelay, sleep } from './utility/time';
28+
import type { AbilityTarget } from './multiplayer/types';
29+
import { getVisibilityAwareDelay } from './utility/time';
2930
import { DEBUG_DISABLE_GAME_STATUS_CONSOLE_LOG, DEBUG_DISABLE_MUSIC } from './debug';
3031
import { Point, configure as configurePointFacade } from './utility/pointfacade';
3132
import { pretty as version } from './utility/version';
@@ -925,10 +926,10 @@ export default class Game {
925926
const intent = message.intent;
926927
switch (intent.kind) {
927928
case 'skip':
928-
this.action({ action: 'skip' }, { callback() {} });
929+
this.action({ action: 'skip' }, {});
929930
break;
930931
case 'delay':
931-
this.action({ action: 'delay' }, { callback() {} });
932+
this.action({ action: 'delay' }, {});
932933
break;
933934
case 'move':
934935
this.action(
@@ -942,8 +943,13 @@ export default class Game {
942943
break;
943944
case 'ability':
944945
this.action(
945-
{ action: 'ability', id: intent.id, target: intent.target, args: intent.args },
946-
{ callback() {} },
946+
{
947+
action: 'ability',
948+
id: intent.id,
949+
target: intent.target,
950+
args: intent.args,
951+
},
952+
{},
947953
);
948954
break;
949955
}
@@ -1100,17 +1106,7 @@ export default class Game {
11001106
});
11011107
}
11021108

1103-
sendMultiplayerAbility(params: {
1104-
target: {
1105-
type: string;
1106-
x?: number;
1107-
y?: number;
1108-
crea?: number;
1109-
array?: Array<{ x: number; y: number }>;
1110-
};
1111-
id: number;
1112-
args: unknown[];
1113-
}): void {
1109+
sendMultiplayerAbility(params: { target: AbilityTarget; id: number; args: unknown[] }): void {
11141110
if (!this.multiplayer || !this.lobby || !this.activeCreature) {
11151111
return;
11161112
}
@@ -1124,15 +1120,15 @@ export default class Game {
11241120
this.sendIntent({
11251121
kind: 'ability',
11261122
id: params.id,
1127-
target: params.target as any,
1123+
target: params.target,
11281124
args: params.args,
11291125
} as Intent);
11301126
return;
11311127
}
11321128
this.lobby.sendAction({
11331129
type: 'action-ability',
11341130
id: params.id,
1135-
target: params.target as any, // eslint-disable-line @typescript-eslint/no-explicit-any
1131+
target: params.target,
11361132
args: params.args,
11371133
playerId: this.lobby.getLocalPlayer()?.playerId || '',
11381134
creatureId: this.activeCreature.id,
@@ -1159,7 +1155,7 @@ export default class Game {
11591155
// which are stricter than the serializable snapshot. Cast to `any` so the
11601156
// authoritative state can drive the live game without fighting internal
11611157
// types; the fields we set are the canonical ones `serializeState` reads.
1162-
const g = this as any;
1158+
const g = this as any; // eslint-disable-line @typescript-eslint/no-explicit-any
11631159
for (const snap of state.creatures) {
11641160
const creature = g.creatures[snap.id];
11651161
if (!creature) {

0 commit comments

Comments
 (0)