mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-03 03:03:24 -04:00
chore: Enable typescript/no-explicit-any rule.
This commit is contained in:
@@ -181,18 +181,14 @@ describe("color allocation", () => {
|
||||
});
|
||||
|
||||
it("allocates next unused color from palette", () => {
|
||||
// biome-ignore lint/style/noNonNullAssertion: Test file with known array
|
||||
const usedColors = new Set([PROFILE_COLORS[0].toUpperCase()]);
|
||||
expect(allocateColor(usedColors)).toBe(PROFILE_COLORS[1]);
|
||||
});
|
||||
|
||||
it("skips multiple used colors", () => {
|
||||
const usedColors = new Set([
|
||||
// biome-ignore lint/style/noNonNullAssertion: Test file with known array
|
||||
PROFILE_COLORS[0].toUpperCase(),
|
||||
// biome-ignore lint/style/noNonNullAssertion: Test file with known array
|
||||
PROFILE_COLORS[1].toUpperCase(),
|
||||
// biome-ignore lint/style/noNonNullAssertion: Test file with known array
|
||||
PROFILE_COLORS[2].toUpperCase(),
|
||||
]);
|
||||
expect(allocateColor(usedColors)).toBe(PROFILE_COLORS[3]);
|
||||
|
||||
@@ -100,7 +100,6 @@ export function allocateColor(usedColors: Set<string>): string {
|
||||
}
|
||||
// All colors used, cycle based on count
|
||||
const index = usedColors.size % PROFILE_COLORS.length;
|
||||
// biome-ignore lint/style/noNonNullAssertion: Array is non-empty constant
|
||||
return PROFILE_COLORS[index] ?? PROFILE_COLORS[0];
|
||||
}
|
||||
|
||||
|
||||
@@ -51,12 +51,11 @@ describe("browser server-context ensureTabAvailable", () => {
|
||||
} as unknown as Response;
|
||||
});
|
||||
|
||||
// @ts-expect-error test override
|
||||
global.fetch = fetchMock;
|
||||
|
||||
const state: BrowserServerState = {
|
||||
// unused in these tests
|
||||
// biome-ignore lint/suspicious/noExplicitAny: test stub
|
||||
// oxlint-disable-next-line typescript/no-explicit-any
|
||||
server: null as any,
|
||||
port: 0,
|
||||
resolved: {
|
||||
@@ -113,11 +112,10 @@ describe("browser server-context ensureTabAvailable", () => {
|
||||
return { ok: true, json: async () => next } as unknown as Response;
|
||||
});
|
||||
|
||||
// @ts-expect-error test override
|
||||
global.fetch = fetchMock;
|
||||
|
||||
const state: BrowserServerState = {
|
||||
// biome-ignore lint/suspicious/noExplicitAny: test stub
|
||||
// oxlint-disable-next-line typescript/no-explicit-any
|
||||
server: null as any,
|
||||
port: 0,
|
||||
resolved: {
|
||||
@@ -164,11 +162,11 @@ describe("browser server-context ensureTabAvailable", () => {
|
||||
}
|
||||
return { ok: true, json: async () => next } as unknown as Response;
|
||||
});
|
||||
// @ts-expect-error test override
|
||||
|
||||
global.fetch = fetchMock;
|
||||
|
||||
const state: BrowserServerState = {
|
||||
// biome-ignore lint/suspicious/noExplicitAny: test stub
|
||||
// oxlint-disable-next-line typescript/no-explicit-any
|
||||
server: null as any,
|
||||
port: 0,
|
||||
resolved: {
|
||||
|
||||
@@ -15,7 +15,7 @@ function makeState(
|
||||
profile: "remote" | "openclaw",
|
||||
): BrowserServerState & { profiles: Map<string, { lastTargetId?: string | null }> } {
|
||||
return {
|
||||
// biome-ignore lint/suspicious/noExplicitAny: test stub
|
||||
// oxlint-disable-next-line typescript/no-explicit-any
|
||||
server: null as any,
|
||||
port: 0,
|
||||
resolved: {
|
||||
@@ -67,7 +67,7 @@ describe("browser server-context remote profile tab operations", () => {
|
||||
const fetchMock = vi.fn(async () => {
|
||||
throw new Error("unexpected fetch");
|
||||
});
|
||||
// @ts-expect-error test override
|
||||
|
||||
global.fetch = fetchMock;
|
||||
|
||||
const { createBrowserRouteContext } = await import("./server-context.js");
|
||||
@@ -134,7 +134,7 @@ describe("browser server-context remote profile tab operations", () => {
|
||||
const fetchMock = vi.fn(async () => {
|
||||
throw new Error("unexpected fetch");
|
||||
});
|
||||
// @ts-expect-error test override
|
||||
|
||||
global.fetch = fetchMock;
|
||||
|
||||
const { createBrowserRouteContext } = await import("./server-context.js");
|
||||
@@ -163,7 +163,7 @@ describe("browser server-context remote profile tab operations", () => {
|
||||
const fetchMock = vi.fn(async () => {
|
||||
throw new Error("unexpected fetch");
|
||||
});
|
||||
// @ts-expect-error test override
|
||||
|
||||
global.fetch = fetchMock;
|
||||
|
||||
const { createBrowserRouteContext } = await import("./server-context.js");
|
||||
@@ -191,7 +191,7 @@ describe("browser server-context remote profile tab operations", () => {
|
||||
const fetchMock = vi.fn(async () => {
|
||||
throw new Error("unexpected fetch");
|
||||
});
|
||||
// @ts-expect-error test override
|
||||
|
||||
global.fetch = fetchMock;
|
||||
|
||||
const { createBrowserRouteContext } = await import("./server-context.js");
|
||||
@@ -229,7 +229,7 @@ describe("browser server-context remote profile tab operations", () => {
|
||||
],
|
||||
} as unknown as Response;
|
||||
});
|
||||
// @ts-expect-error test override
|
||||
|
||||
global.fetch = fetchMock;
|
||||
|
||||
const { createBrowserRouteContext } = await import("./server-context.js");
|
||||
@@ -273,7 +273,7 @@ describe("browser server-context tab selection state", () => {
|
||||
],
|
||||
} as unknown as Response;
|
||||
});
|
||||
// @ts-expect-error test override
|
||||
|
||||
global.fetch = fetchMock;
|
||||
|
||||
const { createBrowserRouteContext } = await import("./server-context.js");
|
||||
|
||||
Reference in New Issue
Block a user