fix eslint config

This commit is contained in:
Nathaniel Tampus
2023-05-12 19:23:00 +08:00
parent e990ed9f57
commit c71ee3056d
7 changed files with 17 additions and 8 deletions

View File

@@ -9,11 +9,13 @@ import { db } from "../db/index.js";
const PGSession = PGSimple(session);
declare module "express-session" {
// eslint-disable-next-line no-unused-vars
interface SessionData {
user: User;
}
}
declare module "http" {
// eslint-disable-next-line no-unused-vars
interface IncomingMessage {
session: Session & {
user: User;

View File

@@ -152,6 +152,7 @@ export async function claimAbandoned(this: Socket, type: "win" | "draw") {
activeGames.splice(activeGames.indexOf(game), 1);
}
// eslint-disable-next-line no-unused-vars
export async function getLatestGame(this: Socket) {
const game = activeGames.find((g) => g.code === Array.from(this.rooms)[1]);
if (game) this.emit("receivedLatestGame", game);
@@ -219,6 +220,7 @@ export async function sendMove(this: Socket, m: { from: string; to: string; prom
}
}
// eslint-disable-next-line no-unused-vars
export async function joinAsPlayer(this: Socket) {
const game = activeGames.find((g) => g.code === Array.from(this.rooms)[1]);
if (!game) return;