feat: enable type-aware no-floating-promises rule, fix all 177 violations (#22741)
This commit is contained in:
@@ -134,7 +134,7 @@ export namespace Database {
|
||||
if (err instanceof LocalContext.NotFound) {
|
||||
const effects: (() => void | Promise<void>)[] = []
|
||||
const result = ctx.provide({ effects, tx: Client() }, () => callback(Client()))
|
||||
for (const effect of effects) effect()
|
||||
for (const effect of effects) void effect()
|
||||
return result
|
||||
}
|
||||
throw err
|
||||
@@ -146,7 +146,7 @@ export namespace Database {
|
||||
try {
|
||||
ctx.use().effects.push(bound)
|
||||
} catch {
|
||||
bound()
|
||||
void bound()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -165,7 +165,7 @@ export namespace Database {
|
||||
const effects: (() => void | Promise<void>)[] = []
|
||||
const txCallback = InstanceState.bind((tx: TxOrDb) => ctx.provide({ tx, effects }, () => callback(tx)))
|
||||
const result = Client().transaction(txCallback, { behavior: options?.behavior })
|
||||
for (const effect of effects) effect()
|
||||
for (const effect of effects) void effect()
|
||||
return result as NotPromise<T>
|
||||
}
|
||||
throw err
|
||||
|
||||
Reference in New Issue
Block a user