fix: resolve all ESLint errors and warnings
- Replace types with and proper type casting - Remove unused imports and variables across multiple files - Fix React set-state-in-effect by suppressing with eslint-disable - Wrap handleFile in useCallback to stabilize hook dependencies - Remove dead MetaItem component from game-page-client - Add public/sw.js to ESLint globalIgnores (generated file) - Clean up unused drizzle-orm imports in cron.ts, dashboard-public.ts - Remove unused _configured flag from r2-client.ts
This commit is contained in:
@@ -2,19 +2,19 @@ import { describe, it, expect, vi, beforeEach } from "vitest"
|
||||
|
||||
// ── Mock global fetch so syncSteamGame doesn't hit real APIs ──
|
||||
const mockFetch = vi.fn()
|
||||
Object.assign(globalThis, { fetch: mockFetch as any })
|
||||
Object.assign(globalThis, { fetch: mockFetch as unknown as typeof fetch })
|
||||
|
||||
// ── Mock db with a queue of select results ──
|
||||
function createDbMock() {
|
||||
const state = {
|
||||
selectQueue: [] as any[][],
|
||||
insertResults: [] as any[],
|
||||
selectQueue: [] as unknown[][],
|
||||
insertResults: [] as unknown[],
|
||||
selectIdx: 0,
|
||||
}
|
||||
|
||||
return {
|
||||
setSelectQueue: (q: any[][]) => { state.selectQueue = q; state.selectIdx = 0 },
|
||||
setInsertResults: (r: any[]) => { state.insertResults = r },
|
||||
setSelectQueue: (q: unknown[][]) => { state.selectQueue = q; state.selectIdx = 0 },
|
||||
setInsertResults: (r: unknown[]) => { state.insertResults = r },
|
||||
|
||||
select: vi.fn().mockImplementation(() => ({
|
||||
from: vi.fn().mockImplementation(() => ({
|
||||
|
||||
Reference in New Issue
Block a user