mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-03 20:04:05 +00:00
chore(lint): enable stricter oxlint rules
This commit is contained in:
@@ -8,6 +8,7 @@ import path from "node:path";
|
||||
import { pathToFileURL } from "node:url";
|
||||
import { promisify } from "node:util";
|
||||
import { formatErrorMessage } from "../../src/infra/errors.ts";
|
||||
import { readBoundedResponseText } from "../lib/bounded-response.ts";
|
||||
import {
|
||||
maskIdentifier,
|
||||
parseStrictIntegerOption,
|
||||
@@ -15,7 +16,6 @@ import {
|
||||
redactForDevToolLog,
|
||||
redactHomePath,
|
||||
} from "../lib/dev-tooling-safety.ts";
|
||||
import { readBoundedResponseText } from "../lib/bounded-response.ts";
|
||||
|
||||
function writeStdoutLine(message: string): void {
|
||||
process.stdout.write(`${message}\n`);
|
||||
@@ -473,10 +473,10 @@ async function discordWebhookApi<T>(params: {
|
||||
timeoutMs?: number;
|
||||
}): Promise<T> {
|
||||
const suffix = params.query ? `?${params.query}` : "";
|
||||
const path = `/webhooks/${encodeURIComponent(params.webhookId)}/${encodeURIComponent(params.webhookToken)}${suffix}`;
|
||||
const pathLocal = `/webhooks/${encodeURIComponent(params.webhookId)}/${encodeURIComponent(params.webhookToken)}${suffix}`;
|
||||
return requestDiscordJson<T>({
|
||||
method: params.method,
|
||||
path,
|
||||
path: pathLocal,
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
|
||||
@@ -222,7 +222,7 @@ async function smokeOpenAIWebRtc(browser: Browser, apiKey: string): Promise<Smok
|
||||
async ({ clientSecret: secret, sdpAnswerMaxBytes, timeoutMs }) => {
|
||||
const responseBodyTooLargeError = (label: string, maxBytes: number): Error =>
|
||||
new Error(`${label} response body exceeded ${maxBytes} bytes`);
|
||||
const readBoundedText = async (
|
||||
const readBoundedTextLocal = async (
|
||||
response: Response,
|
||||
label: string,
|
||||
maxBytes: number,
|
||||
@@ -341,7 +341,7 @@ async function smokeOpenAIWebRtc(browser: Browser, apiKey: string): Promise<Smok
|
||||
if (!response.ok) {
|
||||
throw new Error(`OpenAI Realtime SDP offer failed (${response.status})`);
|
||||
}
|
||||
return await readBoundedText(
|
||||
return await readBoundedTextLocal(
|
||||
response,
|
||||
"OpenAI Realtime SDP answer",
|
||||
sdpAnswerMaxBytes,
|
||||
|
||||
Reference in New Issue
Block a user