mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-12 07:20:45 +00:00
chore: Enable eslint/no-unused-vars.
This commit is contained in:
@@ -18,13 +18,13 @@
|
|||||||
"typescript/no-unsafe-type-assertion": "off",
|
"typescript/no-unsafe-type-assertion": "off",
|
||||||
"typescript/no-unnecessary-template-expression": "off",
|
"typescript/no-unnecessary-template-expression": "off",
|
||||||
"unicorn/consistent-function-scoping": "off",
|
"unicorn/consistent-function-scoping": "off",
|
||||||
|
"unicorn/require-post-message-target-origin": "off",
|
||||||
"typescript/no-extraneous-class": "off",
|
"typescript/no-extraneous-class": "off",
|
||||||
"oxc/no-async-endpoint-handlers": "off",
|
"oxc/no-async-endpoint-handlers": "off",
|
||||||
"eslint/no-useless-concat": "off",
|
"eslint/no-useless-concat": "off",
|
||||||
"eslint/no-unused-vars": "off",
|
"eslint/no-unused-vars": "error",
|
||||||
"eslint/no-new": "off",
|
"eslint/no-new": "off",
|
||||||
"eslint/preserve-caught-error": "off",
|
"eslint/preserve-caught-error": "off",
|
||||||
"unicorn/require-post-message-target-origin": "off",
|
|
||||||
},
|
},
|
||||||
"ignorePatterns": ["src/canvas-host/a2ui/a2ui.bundle.js"]
|
"ignorePatterns": ["src/canvas-host/a2ui/a2ui.bundle.js"]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { getOAuthApiKey, type OAuthCredentials, type OAuthProvider } from "@mariozechner/pi-ai";
|
import { getOAuthApiKey, type OAuthCredentials } from "@mariozechner/pi-ai";
|
||||||
import lockfile from "proper-lockfile";
|
import lockfile from "proper-lockfile";
|
||||||
|
|
||||||
import type { OpenClawConfig } from "../../config/config.js";
|
import type { OpenClawConfig } from "../../config/config.js";
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ import fs from "node:fs/promises";
|
|||||||
import path from "node:path";
|
import path from "node:path";
|
||||||
|
|
||||||
import type { AgentMessage, StreamFn } from "@mariozechner/pi-agent-core";
|
import type { AgentMessage, StreamFn } from "@mariozechner/pi-agent-core";
|
||||||
import type { Api, Model } from "@mariozechner/pi-ai";
|
|
||||||
|
|
||||||
import type { OpenClawConfig } from "../config/config.js";
|
import type { OpenClawConfig } from "../config/config.js";
|
||||||
import { resolveStateDir } from "../config/paths.js";
|
import { resolveStateDir } from "../config/paths.js";
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import type { StreamFn } from "@mariozechner/pi-agent-core";
|
import type { StreamFn } from "@mariozechner/pi-agent-core";
|
||||||
import type { Api, Model, SimpleStreamOptions } from "@mariozechner/pi-ai";
|
import type { SimpleStreamOptions } from "@mariozechner/pi-ai";
|
||||||
import { streamSimple } from "@mariozechner/pi-ai";
|
import { streamSimple } from "@mariozechner/pi-ai";
|
||||||
|
|
||||||
import type { OpenClawConfig } from "../../config/config.js";
|
import type { OpenClawConfig } from "../../config/config.js";
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import type { AgentEvent, AgentMessage } from "@mariozechner/pi-agent-core";
|
import type { AgentEvent, AgentMessage } from "@mariozechner/pi-agent-core";
|
||||||
import type { AssistantMessage } from "@mariozechner/pi-ai";
|
|
||||||
|
|
||||||
import { parseReplyDirectives } from "../auto-reply/reply/reply-directives.js";
|
import { parseReplyDirectives } from "../auto-reply/reply/reply-directives.js";
|
||||||
import { emitAgentEvent } from "../infra/agent-events.js";
|
import { emitAgentEvent } from "../infra/agent-events.js";
|
||||||
|
|||||||
@@ -1,13 +1,7 @@
|
|||||||
import fs from "node:fs/promises";
|
import fs from "node:fs/promises";
|
||||||
import path from "node:path";
|
import path from "node:path";
|
||||||
|
|
||||||
import {
|
import { type Api, type Context, complete, type Model } from "@mariozechner/pi-ai";
|
||||||
type Api,
|
|
||||||
type AssistantMessage,
|
|
||||||
type Context,
|
|
||||||
complete,
|
|
||||||
type Model,
|
|
||||||
} from "@mariozechner/pi-ai";
|
|
||||||
import { discoverAuthStorage, discoverModels } from "../pi-model-discovery.js";
|
import { discoverAuthStorage, discoverModels } from "../pi-model-discovery.js";
|
||||||
import { Type } from "@sinclair/typebox";
|
import { Type } from "@sinclair/typebox";
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
import type { Page } from "playwright-core";
|
|
||||||
|
|
||||||
import { type AriaSnapshotNode, formatAriaSnapshot, type RawAXNode } from "./cdp.js";
|
import { type AriaSnapshotNode, formatAriaSnapshot, type RawAXNode } from "./cdp.js";
|
||||||
import {
|
import {
|
||||||
buildRoleSnapshotFromAiSnapshot,
|
buildRoleSnapshotFromAiSnapshot,
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
import type { RESTGetAPIChannelResult, RESTGetAPIGuildChannelsResult } from "discord-api-types/v10";
|
|
||||||
|
|
||||||
import { fetchDiscord } from "./api.js";
|
import { fetchDiscord } from "./api.js";
|
||||||
import { normalizeDiscordSlug } from "./monitor/allow-list.js";
|
import { normalizeDiscordSlug } from "./monitor/allow-list.js";
|
||||||
import { normalizeDiscordToken } from "./token.js";
|
import { normalizeDiscordToken } from "./token.js";
|
||||||
|
|||||||
@@ -26,8 +26,6 @@ import {
|
|||||||
import { normalizeAgentId } from "../../routing/session-key.js";
|
import { normalizeAgentId } from "../../routing/session-key.js";
|
||||||
import { parseMessageWithAttachments } from "../chat-attachments.js";
|
import { parseMessageWithAttachments } from "../chat-attachments.js";
|
||||||
import {
|
import {
|
||||||
type AgentIdentityParams,
|
|
||||||
type AgentWaitParams,
|
|
||||||
ErrorCodes,
|
ErrorCodes,
|
||||||
errorShape,
|
errorShape,
|
||||||
formatValidationErrors,
|
formatValidationErrors,
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import { getChannelPlugin, normalizeChannelId } from "../../channels/plugins/index.js";
|
import { getChannelPlugin, normalizeChannelId } from "../../channels/plugins/index.js";
|
||||||
import type { ChannelId } from "../../channels/plugins/types.js";
|
|
||||||
import { DEFAULT_CHAT_CHANNEL } from "../../channels/registry.js";
|
import { DEFAULT_CHAT_CHANNEL } from "../../channels/registry.js";
|
||||||
import { loadConfig } from "../../config/config.js";
|
import { loadConfig } from "../../config/config.js";
|
||||||
import { createOutboundSendDeps } from "../../cli/deps.js";
|
import { createOutboundSendDeps } from "../../cli/deps.js";
|
||||||
@@ -10,7 +9,6 @@ import {
|
|||||||
resolveOutboundSessionRoute,
|
resolveOutboundSessionRoute,
|
||||||
} from "../../infra/outbound/outbound-session.js";
|
} from "../../infra/outbound/outbound-session.js";
|
||||||
import { resolveSessionAgentId } from "../../agents/agent-scope.js";
|
import { resolveSessionAgentId } from "../../agents/agent-scope.js";
|
||||||
import type { OutboundChannel } from "../../infra/outbound/targets.js";
|
|
||||||
import { resolveOutboundTarget } from "../../infra/outbound/targets.js";
|
import { resolveOutboundTarget } from "../../infra/outbound/targets.js";
|
||||||
import { normalizePollInput } from "../../polls.js";
|
import { normalizePollInput } from "../../polls.js";
|
||||||
import {
|
import {
|
||||||
|
|||||||
@@ -35,7 +35,6 @@ import {
|
|||||||
errorShape,
|
errorShape,
|
||||||
formatValidationErrors,
|
formatValidationErrors,
|
||||||
PROTOCOL_VERSION,
|
PROTOCOL_VERSION,
|
||||||
type RequestFrame,
|
|
||||||
validateConnectParams,
|
validateConnectParams,
|
||||||
validateRequestFrame,
|
validateRequestFrame,
|
||||||
} from "../../protocol/index.js";
|
} from "../../protocol/index.js";
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import type { OpenClawConfig } from "../../../config/config.js";
|
|
||||||
import { isSubagentSessionKey } from "../../../routing/session-key.js";
|
import { isSubagentSessionKey } from "../../../routing/session-key.js";
|
||||||
import { resolveHookConfig } from "../../config.js";
|
import { resolveHookConfig } from "../../config.js";
|
||||||
import { isAgentBootstrapEvent, type HookHandler } from "../../hooks.js";
|
import { isAgentBootstrapEvent, type HookHandler } from "../../hooks.js";
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import { getChannelPlugin, normalizeChannelId } from "../../channels/plugins/index.js";
|
import { getChannelPlugin, normalizeChannelId } from "../../channels/plugins/index.js";
|
||||||
import type { ChannelId } from "../../channels/plugins/types.js";
|
|
||||||
import type { OpenClawConfig } from "../../config/config.js";
|
import type { OpenClawConfig } from "../../config/config.js";
|
||||||
import { loadConfig } from "../../config/config.js";
|
import { loadConfig } from "../../config/config.js";
|
||||||
import { callGateway, randomIdempotencyKey } from "../../gateway/call.js";
|
import { callGateway, randomIdempotencyKey } from "../../gateway/call.js";
|
||||||
@@ -18,7 +17,6 @@ import {
|
|||||||
type OutboundSendDeps,
|
type OutboundSendDeps,
|
||||||
} from "./deliver.js";
|
} from "./deliver.js";
|
||||||
import { normalizeReplyPayloadsForDelivery } from "./payloads.js";
|
import { normalizeReplyPayloadsForDelivery } from "./payloads.js";
|
||||||
import type { OutboundChannel } from "./targets.js";
|
|
||||||
import { resolveOutboundTarget } from "./targets.js";
|
import { resolveOutboundTarget } from "./targets.js";
|
||||||
|
|
||||||
export type MessageGatewayOptions = {
|
export type MessageGatewayOptions = {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { getChannelPlugin, normalizeChannelId } from "../../channels/plugins/index.js";
|
import { getChannelPlugin, normalizeChannelId } from "../../channels/plugins/index.js";
|
||||||
import { formatCliCommand } from "../../cli/command-format.js";
|
import { formatCliCommand } from "../../cli/command-format.js";
|
||||||
import type { ChannelId, ChannelOutboundTargetMode } from "../../channels/plugins/types.js";
|
import type { ChannelOutboundTargetMode } from "../../channels/plugins/types.js";
|
||||||
import type { OpenClawConfig } from "../../config/config.js";
|
import type { OpenClawConfig } from "../../config/config.js";
|
||||||
import type { SessionEntry } from "../../config/sessions.js";
|
import type { SessionEntry } from "../../config/sessions.js";
|
||||||
import type { AgentDefaultsConfig } from "../../config/types.agent-defaults.js";
|
import type { AgentDefaultsConfig } from "../../config/types.agent-defaults.js";
|
||||||
|
|||||||
@@ -1,11 +1,4 @@
|
|||||||
import type {
|
import type { MessageEvent, StickerEventMessage, EventSource, PostbackEvent } from "@line/bot-sdk";
|
||||||
MessageEvent,
|
|
||||||
TextEventMessage,
|
|
||||||
StickerEventMessage,
|
|
||||||
LocationEventMessage,
|
|
||||||
EventSource,
|
|
||||||
PostbackEvent,
|
|
||||||
} from "@line/bot-sdk";
|
|
||||||
import { formatInboundEnvelope, resolveEnvelopeFormatOptions } from "../auto-reply/envelope.js";
|
import { formatInboundEnvelope, resolveEnvelopeFormatOptions } from "../auto-reply/envelope.js";
|
||||||
import { finalizeInboundContext } from "../auto-reply/reply/inbound-context.js";
|
import { finalizeInboundContext } from "../auto-reply/reply/inbound-context.js";
|
||||||
import { formatLocationText, toLocationContext } from "../channels/location.js";
|
import { formatLocationText, toLocationContext } from "../channels/location.js";
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import type { Api, AssistantMessage, Context, Model } from "@mariozechner/pi-ai";
|
import type { Api, Context, Model } from "@mariozechner/pi-ai";
|
||||||
import { complete } from "@mariozechner/pi-ai";
|
import { complete } from "@mariozechner/pi-ai";
|
||||||
import { discoverAuthStorage, discoverModels } from "../../agents/pi-model-discovery.js";
|
import { discoverAuthStorage, discoverModels } from "../../agents/pi-model-discovery.js";
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { enqueueSystemEvent } from "../../../infra/system-events.js";
|
|||||||
|
|
||||||
import { resolveSlackChannelLabel } from "../channel-config.js";
|
import { resolveSlackChannelLabel } from "../channel-config.js";
|
||||||
import type { SlackMonitorContext } from "../context.js";
|
import type { SlackMonitorContext } from "../context.js";
|
||||||
import type { SlackMessageEvent, SlackReactionEvent } from "../types.js";
|
import type { SlackReactionEvent } from "../types.js";
|
||||||
|
|
||||||
export function registerSlackReactionEvents(params: { ctx: SlackMonitorContext }) {
|
export function registerSlackReactionEvents(params: { ctx: SlackMonitorContext }) {
|
||||||
const { ctx } = params;
|
const { ctx } = params;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { type AddressInfo, createServer } from "node:net";
|
import { createServer } from "node:net";
|
||||||
import { isMainThread, threadId } from "node:worker_threads";
|
import { isMainThread, threadId } from "node:worker_threads";
|
||||||
|
|
||||||
async function isPortFree(port: number): Promise<boolean> {
|
async function isPortFree(port: number): Promise<boolean> {
|
||||||
|
|||||||
@@ -1,11 +1,4 @@
|
|||||||
import {
|
import { Editor, Key, matchesKey } from "@mariozechner/pi-tui";
|
||||||
Editor,
|
|
||||||
type EditorOptions,
|
|
||||||
type EditorTheme,
|
|
||||||
type TUI,
|
|
||||||
Key,
|
|
||||||
matchesKey,
|
|
||||||
} from "@mariozechner/pi-tui";
|
|
||||||
|
|
||||||
export class CustomEditor extends Editor {
|
export class CustomEditor extends Editor {
|
||||||
onEscape?: () => void;
|
onEscape?: () => void;
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import { DEFAULT_BOOTSTRAP_FILENAME } from "../agents/workspace.js";
|
|||||||
import {
|
import {
|
||||||
DEFAULT_GATEWAY_DAEMON_RUNTIME,
|
DEFAULT_GATEWAY_DAEMON_RUNTIME,
|
||||||
GATEWAY_DAEMON_RUNTIME_OPTIONS,
|
GATEWAY_DAEMON_RUNTIME_OPTIONS,
|
||||||
type GatewayDaemonRuntime,
|
|
||||||
} from "../commands/daemon-runtime.js";
|
} from "../commands/daemon-runtime.js";
|
||||||
import { healthCommand } from "../commands/health.js";
|
import { healthCommand } from "../commands/health.js";
|
||||||
import { formatHealthCheckFailure } from "../commands/health-format.js";
|
import { formatHealthCheckFailure } from "../commands/health-format.js";
|
||||||
|
|||||||
Reference in New Issue
Block a user