feat: enable type-aware no-floating-promises rule, fix all 177 violations (#22741)

This commit is contained in:
Kit Langton
2026-04-15 23:27:32 -04:00
committed by GitHub
parent 343a564183
commit 80f1f1b5b8
103 changed files with 212 additions and 187 deletions

View File

@@ -27,7 +27,7 @@ import { ProviderTest } from "../fake/provider"
import { testEffect } from "../lib/effect"
import * as CrossSpawnSpawner from "../../src/effect/cross-spawn-spawner"
Log.init({ print: false })
void Log.init({ print: false })
function run<A, E>(fx: Effect.Effect<A, E, SessionNs.Service>) {
return Effect.runPromise(fx.pipe(Effect.provide(SessionNs.defaultLayer)))

View File

@@ -229,7 +229,7 @@ beforeEach(() => {
})
afterAll(() => {
state.server?.stop()
void state.server?.stop()
})
function createChatStream(text: string) {

View File

@@ -9,7 +9,7 @@ import { ModelID, ProviderID } from "../../src/provider/schema"
import { Log } from "../../src/util"
const root = path.join(__dirname, "../..")
Log.init({ print: false })
void Log.init({ print: false })
function run<A, E>(fx: Effect.Effect<A, E, SessionNs.Service>) {
return Effect.runPromise(fx.pipe(Effect.provide(SessionNs.defaultLayer)))

View File

@@ -24,7 +24,7 @@ import { provideTmpdirServer } from "../fixture/fixture"
import { testEffect } from "../lib/effect"
import { raw, reply, TestLLMServer } from "../lib/llm-server"
Log.init({ print: false })
void Log.init({ print: false })
const summary = Layer.succeed(
SessionSummary.Service,

View File

@@ -44,7 +44,7 @@ import { provideTmpdirInstance, provideTmpdirServer } from "../fixture/fixture"
import { testEffect } from "../lib/effect"
import { reply, TestLLMServer } from "../lib/llm-server"
Log.init({ print: false })
void Log.init({ print: false })
const summary = Layer.succeed(
SessionSummary.Service,

View File

@@ -11,7 +11,7 @@ import { SessionPrompt } from "../../src/session/prompt"
import { Log } from "../../src/util"
import { tmpdir } from "../fixture/fixture"
Log.init({ print: false })
void Log.init({ print: false })
function run<A, E>(fx: Effect.Effect<A, E, SessionPrompt.Service | Session.Service>) {
return Effect.runPromise(
@@ -316,7 +316,7 @@ describe("session.prompt regression", () => {
),
})
} finally {
server.stop(true)
void server.stop(true)
}
})
@@ -409,7 +409,7 @@ describe("session.prompt regression", () => {
),
})
} finally {
server.stop(true)
void server.stop(true)
}
})
})

View File

@@ -13,7 +13,7 @@ import * as CrossSpawnSpawner from "../../src/effect/cross-spawn-spawner"
import { provideTmpdirInstance } from "../fixture/fixture"
import { testEffect } from "../lib/effect"
Log.init({ print: false })
void Log.init({ print: false })
const env = Layer.mergeAll(
Session.defaultLayer,

View File

@@ -10,7 +10,7 @@ import { AppRuntime } from "../../src/effect/app-runtime"
import { tmpdir } from "../fixture/fixture"
const projectRoot = path.join(__dirname, "../..")
Log.init({ print: false })
void Log.init({ print: false })
function create(input?: SessionNs.CreateInput) {
return AppRuntime.runPromise(SessionNs.Service.use((svc) => svc.create(input)))

View File

@@ -57,7 +57,7 @@ import * as CrossSpawnSpawner from "../../src/effect/cross-spawn-spawner"
import { Ripgrep } from "../../src/file/ripgrep"
import { Format } from "../../src/format"
Log.init({ print: false })
void Log.init({ print: false })
const mcp = Layer.succeed(
MCP.Service,

View File

@@ -8,7 +8,7 @@ import { Instance } from "../../src/project/instance"
import { MessageV2 } from "../../src/session/message-v2"
const projectRoot = path.join(__dirname, "../..")
Log.init({ print: false })
void Log.init({ print: false })
// Skip tests if no API key is available
const hasApiKey = !!process.env.ANTHROPIC_API_KEY