From 096d0cf412d24984204abc0ca82b86182a9ea455 Mon Sep 17 00:00:00 2001 From: Vincent Koc Date: Mon, 6 Apr 2026 16:55:36 +0100 Subject: [PATCH] chore(lint): type script and test helpers --- scripts/bench-model.ts | 5 ++--- scripts/update-clawtributors.ts | 6 ++---- src/test-utils/vitest-mock-fn.ts | 3 +-- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/scripts/bench-model.ts b/scripts/bench-model.ts index f1698737e37..471338d3451 100644 --- a/scripts/bench-model.ts +++ b/scripts/bench-model.ts @@ -1,4 +1,4 @@ -import { completeSimple, getModel, type Model } from "@mariozechner/pi-ai"; +import { completeSimple, getModel, type Api, type Model } from "@mariozechner/pi-ai"; type Usage = { input?: number; @@ -49,8 +49,7 @@ function median(values: number[]): number { async function runModel(opts: { label: string; - // oxlint-disable-next-line typescript/no-explicit-any - model: Model; + model: Model; apiKey: string; runs: number; prompt: string; diff --git a/scripts/update-clawtributors.ts b/scripts/update-clawtributors.ts index f8479778205..3b61694a4e5 100644 --- a/scripts/update-clawtributors.ts +++ b/scripts/update-clawtributors.ts @@ -329,10 +329,8 @@ function run(cmd: string): string { }).trim(); } -// oxlint-disable-next-line typescript/no-explicit-any -function parsePaginatedJson(raw: string): any[] { - // oxlint-disable-next-line typescript/no-explicit-any - const items: any[] = []; +function parsePaginatedJson(raw: string): unknown[] { + const items: unknown[] = []; for (const line of raw.split("\n")) { if (!line.trim()) { continue; diff --git a/src/test-utils/vitest-mock-fn.ts b/src/test-utils/vitest-mock-fn.ts index 9e9526d7bda..44f32bcebea 100644 --- a/src/test-utils/vitest-mock-fn.ts +++ b/src/test-utils/vitest-mock-fn.ts @@ -1,6 +1,5 @@ // Centralized Vitest mock type for harness modules under `src/`. // Using an explicit named type avoids exporting inferred `vi.fn()` types that can trip TS2742. // -// oxlint-disable-next-line typescript/no-explicit-any -export type MockFn any = (...args: any[]) => any> = +export type MockFn unknown = (...args: never[]) => unknown> = import("vitest").Mock;