chore: add ESLint with no-floating-promises and no-console rules
Sets up ESLint 10 flat config with @typescript-eslint/no-floating-promises (error) and no-console (warn, allow warn/error). Fixes all floating promise errors in server routes, orchestrator reader cleanup, and frontend composables with void operator. Game engine files get warning-level for intentional fire-and-forget async. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
5007d009fe
commit
7d9b8b1dbf
@@ -114,13 +114,13 @@ async function readLimitedBody(res: Response, maxBytes: number): Promise<string>
|
||||
if (done) break
|
||||
totalBytes += value.byteLength
|
||||
if (totalBytes > maxBytes) {
|
||||
reader.cancel()
|
||||
void reader.cancel()
|
||||
throw new Error(`Response body exceeds ${maxBytes} bytes`)
|
||||
}
|
||||
chunks.push(value)
|
||||
}
|
||||
} catch (err) {
|
||||
reader.cancel()
|
||||
void reader.cancel()
|
||||
throw err
|
||||
}
|
||||
const combined = new Uint8Array(totalBytes)
|
||||
|
||||
@@ -391,7 +391,7 @@ fightsRouter.get('/:id/stream', (c) => {
|
||||
})
|
||||
|
||||
const cleanup = fightEvents.on(fightId, (event) => {
|
||||
stream.writeSSE({
|
||||
void stream.writeSSE({
|
||||
event: event.type,
|
||||
data: JSON.stringify({ ...event.data, spectators: spectatorCounts.get(fightId) || 0 }),
|
||||
})
|
||||
@@ -399,7 +399,7 @@ fightsRouter.get('/:id/stream', (c) => {
|
||||
|
||||
const cleanupGlobal = fightEvents.onAll((event) => {
|
||||
if (event.fightId === fightId && event.type === 'fight_end') {
|
||||
stream.writeSSE({
|
||||
void stream.writeSSE({
|
||||
event: 'fight_end',
|
||||
data: JSON.stringify({ ...event.data, spectators: spectatorCounts.get(fightId) || 0 }),
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user