mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-12 01:31:08 +00:00
chore(lint): type script and test helpers
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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>;
|
||||
|
||||
Reference in New Issue
Block a user