chore(lint): type script and test helpers

This commit is contained in:
Vincent Koc
2026-04-06 16:55:36 +01:00
parent e79d2ecd9e
commit 096d0cf412
3 changed files with 5 additions and 9 deletions

View File

@@ -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<any>;
model: Model<Api>;
apiKey: string;
runs: number;
prompt: string;

View File

@@ -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;

View File

@@ -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<T extends (...args: any[]) => any = (...args: any[]) => any> =
export type MockFn<T extends (...args: never[]) => unknown = (...args: never[]) => unknown> =
import("vitest").Mock<T>;