fix(lint): resolve all eslint errors across monorepo
- Type response bodies in gameController.test.ts to fix no-unsafe-member-access - Replace async methods with Promise.resolve() in InMemoryGameSessionStore and InMemoryLobbyGameStore to satisfy require-await rule - Add argsIgnorePattern and varsIgnorePattern to eslint config so underscore-prefixed params are globally ignored - Fix no-misused-promises in ws/index.ts, lobbyHandlers, gameHandlers, __root.tsx, login.tsx and play.tsx by using void + .catch() - Fix no-floating-promises on navigate calls in login.tsx - Move API_URL outside Play component to fix useCallback dependency warning - Type fetch response bodies in play.tsx to fix no-unsafe-assignment - Add only-throw-error: off for route files (TanStack Router throw redirect) - Remove unused WebSocket import from express.d.ts - Fix unsafe return in connections.ts by typing empty Map constructor - Exclude scripts/ folder from eslint - Add targeted override for better-auth auth-client.ts (upstream typing issue)
This commit is contained in:
parent
a6d8ddec3b
commit
ce19740cc8
12 changed files with 160 additions and 91 deletions
|
|
@ -3,22 +3,25 @@ import type { LobbyGameStore, LobbyGameData } from "./LobbyGameStore.js";
|
|||
export class InMemoryLobbyGameStore implements LobbyGameStore {
|
||||
private games = new Map<string, LobbyGameData>();
|
||||
|
||||
async create(lobbyId: string, data: LobbyGameData): Promise<void> {
|
||||
create(lobbyId: string, data: LobbyGameData): Promise<void> {
|
||||
if (this.games.has(lobbyId)) {
|
||||
throw new Error(`Game already exists for lobby: ${lobbyId}`);
|
||||
}
|
||||
this.games.set(lobbyId, data);
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
async get(lobbyId: string): Promise<LobbyGameData | null> {
|
||||
return this.games.get(lobbyId) ?? null;
|
||||
get(lobbyId: string): Promise<LobbyGameData | null> {
|
||||
return Promise.resolve(this.games.get(lobbyId) ?? null);
|
||||
}
|
||||
|
||||
async set(lobbyId: string, data: LobbyGameData): Promise<void> {
|
||||
set(lobbyId: string, data: LobbyGameData): Promise<void> {
|
||||
this.games.set(lobbyId, data);
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
async delete(lobbyId: string): Promise<void> {
|
||||
delete(lobbyId: string): Promise<void> {
|
||||
this.games.delete(lobbyId);
|
||||
return Promise.resolve();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue