diff --git a/eslint.config.js b/eslint.config.js index 7b73cc355f..c707ee03e5 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -41,7 +41,7 @@ export default [ // Disable rules that would fail. The failures should be fixed, and the entries here removed. "@typescript-eslint/no-explicit-any": "off", "@typescript-eslint/no-unused-expressions": "off", - "@typescript-eslint/no-unused-vars": "off", + "no-unused-vars": "off", }, }, { @@ -50,6 +50,13 @@ export default [ "@typescript-eslint/prefer-nullish-coalescing": "error", eqeqeq: "error", "no-case-declarations": "error", + "@typescript-eslint/no-unused-vars": [ + "error", + { + args: "none", + caughtErrors: "none", + }, + ], }, }, ]; diff --git a/src/client/components/Difficulties.ts b/src/client/components/Difficulties.ts index 914c2e90eb..aeafdd49de 100644 --- a/src/client/components/Difficulties.ts +++ b/src/client/components/Difficulties.ts @@ -74,6 +74,7 @@ export class DifficultyDisplay extends LitElement { > `; + // eslint-disable-next-line @typescript-eslint/no-unused-vars const kingSkull = html`; export type PlayerPattern = z.infer; export type Flag = z.infer; export type GameStartInfo = z.infer; -const PlayerTypeSchema = z.enum(PlayerType); export interface GameInfo { gameID: GameID; diff --git a/src/core/configuration/DevConfig.ts b/src/core/configuration/DevConfig.ts index d530795c5f..50336bc58c 100644 --- a/src/core/configuration/DevConfig.ts +++ b/src/core/configuration/DevConfig.ts @@ -65,6 +65,7 @@ export class DevConfig extends DefaultConfig { unitInfo(type: UnitType): UnitInfo { const info = super.unitInfo(type); + // eslint-disable-next-line @typescript-eslint/no-unused-vars const oldCost = info.cost; // info.cost = (p: Player) => oldCost(p) / 1000000000; return info; diff --git a/src/core/game/TeamAssignment.ts b/src/core/game/TeamAssignment.ts index 1ec1bb5669..535626d7de 100644 --- a/src/core/game/TeamAssignment.ts +++ b/src/core/game/TeamAssignment.ts @@ -33,6 +33,7 @@ export function assignTeams( ); // First, assign clan players + // eslint-disable-next-line @typescript-eslint/no-unused-vars for (const [_, clanPlayers] of sortedClans) { // Try to keep the clan together on the team with fewer players let team: Team | null = null; diff --git a/src/core/game/TerrainSearchMap.ts b/src/core/game/TerrainSearchMap.ts index bbcfe420aa..c7366f38d0 100644 --- a/src/core/game/TerrainSearchMap.ts +++ b/src/core/game/TerrainSearchMap.ts @@ -18,8 +18,6 @@ export class TerrainSearchMap { node(x: number, y: number): SearchMapTileType { const packedByte = this.mapData[4 + y * this.width + x]; const isLand = packedByte & 0b10000000; - const shoreline = !!(packedByte & 0b01000000); - const ocean = !!(packedByte & 0b00100000); const magnitude = packedByte & 0b00011111; if (isLand) { return SearchMapTileType.Land; diff --git a/src/server/Master.ts b/src/server/Master.ts index 993a4cec54..d662459dfe 100644 --- a/src/server/Master.ts +++ b/src/server/Master.ts @@ -285,14 +285,13 @@ async function schedulePublicGame(playlist: MapPlaylist) { if (!response.ok) { throw new Error(`Failed to schedule public game: ${response.statusText}`); } - - const data = await response.json(); } catch (error) { log.error(`Failed to schedule public game on worker ${workerPath}:`, error); throw error; } } +// eslint-disable-next-line @typescript-eslint/no-unused-vars function sleep(ms: number): Promise { return new Promise((resolve) => setTimeout(resolve, ms)); } diff --git a/src/server/jwt.ts b/src/server/jwt.ts index d8a74384f5..b0a81dc8b1 100644 --- a/src/server/jwt.ts +++ b/src/server/jwt.ts @@ -27,7 +27,7 @@ export async function verifyClientToken( const issuer = config.jwtIssuer(); const audience = config.jwtAudience(); const key = await config.jwkPublicKey(); - const { payload, protectedHeader } = await jwtVerify(token, key, { + const { payload } = await jwtVerify(token, key, { algorithms: ["EdDSA"], issuer, audience, diff --git a/tests/ShellRandom.test.ts b/tests/ShellRandom.test.ts index 5c55903833..7466087adc 100644 --- a/tests/ShellRandom.test.ts +++ b/tests/ShellRandom.test.ts @@ -85,7 +85,6 @@ describe("Shell Random Damage", () => { expect(damage).toBeLessThanOrEqual(maxExpectedDamage); }); - const uniqueDamages = new Set(damages); expect(damages.length).toBeGreaterThan(0); }); @@ -231,16 +230,6 @@ describe("Shell Random Damage", () => { expect(damages.length).toBeGreaterThan(0); - const baseDamage = game.config().unitInfo(UnitType.Shell).damage ?? 250; - const expectedDamages = [ - Math.round((baseDamage / 250) * 200), - Math.round((baseDamage / 250) * 225), - Math.round((baseDamage / 250) * 250), - Math.round((baseDamage / 250) * 275), - Math.round((baseDamage / 250) * 300), - Math.round((baseDamage / 250) * 325), - ]; - const uniqueDamages = new Set(damages); expect(uniqueDamages.size).toBeGreaterThan(0); @@ -265,7 +254,6 @@ describe("Shell Random Damage", () => { ); const initialHealth = target.health(); - const seed = 12345; const shell1 = new ShellExecution( game.ref(coastX, 10), player1, diff --git a/tests/core/executions/SAMLauncherExecution.test.ts b/tests/core/executions/SAMLauncherExecution.test.ts index 0e7fc0d982..ed7ba534bb 100644 --- a/tests/core/executions/SAMLauncherExecution.test.ts +++ b/tests/core/executions/SAMLauncherExecution.test.ts @@ -83,6 +83,7 @@ describe("SAM", () => { game.addExecution(new SAMLauncherExecution(defender, null, sam)); // Sam will only target nukes it can destroy before it reaches its target + // eslint-disable-next-line @typescript-eslint/no-unused-vars const nuke = attacker.buildUnit(UnitType.AtomBomb, game.ref(1, 1), { targetTile: game.ref(3, 1), trajectory: [