Skip to content

Commit 1831e12

Browse files
committed
fix(lint): clean up main lint regressions
1 parent c25f319 commit 1831e12

7 files changed

Lines changed: 29 additions & 29 deletions

File tree

extensions/canvas/src/cli.ts

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -102,15 +102,23 @@ function parseNodeCandidates(raw: unknown): CanvasNodeCandidate[] {
102102
connected?: unknown;
103103
clientId?: unknown;
104104
};
105-
return typeof node.nodeId === "string"
106-
? {
107-
nodeId: node.nodeId,
108-
...(typeof node.displayName === "string" && { displayName: node.displayName }),
109-
...(typeof node.remoteIp === "string" && { remoteIp: node.remoteIp }),
110-
...(typeof node.connected === "boolean" && { connected: node.connected }),
111-
...(typeof node.clientId === "string" && { clientId: node.clientId }),
112-
}
113-
: null;
105+
if (typeof node.nodeId !== "string") {
106+
return null;
107+
}
108+
const candidate: CanvasNodeCandidate = { nodeId: node.nodeId };
109+
if (typeof node.displayName === "string") {
110+
candidate.displayName = node.displayName;
111+
}
112+
if (typeof node.remoteIp === "string") {
113+
candidate.remoteIp = node.remoteIp;
114+
}
115+
if (typeof node.connected === "boolean") {
116+
candidate.connected = node.connected;
117+
}
118+
if (typeof node.clientId === "string") {
119+
candidate.clientId = node.clientId;
120+
}
121+
return candidate;
114122
})
115123
.filter((entry): entry is CanvasNodeCandidate => entry !== null);
116124
}

extensions/canvas/src/config-migration.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,7 @@ function mergeHostConfig(params: {
1111
legacyHost: MutableRecord;
1212
existingHost: MutableRecord | undefined;
1313
}): MutableRecord {
14-
return {
15-
...params.legacyHost,
16-
...(params.existingHost ?? {}),
17-
};
14+
return Object.assign({}, params.legacyHost, params.existingHost);
1815
}
1916

2017
export function migrateLegacyCanvasHostConfig(config: OpenClawConfig): {

extensions/canvas/src/config.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,7 @@ export function parseCanvasPluginConfig(value: unknown): CanvasPluginConfig {
5959
return {};
6060
}
6161
const host = parseCanvasHostConfig(value.host);
62-
return {
63-
...(host ? { host } : {}),
64-
};
62+
return host ? { host } : {};
6563
}
6664

6765
export function isCanvasPluginEnabled(config?: OpenClawConfig): boolean {

src/gateway/server-http.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,6 @@ export function createGatewayHttpServer(opts: {
497497
strictTransportSecurityHeader,
498498
handleHooksRequest,
499499
handlePluginRequest,
500-
handlePluginUpgrade,
501500
shouldEnforcePluginGatewayAuth,
502501
resolvePluginNodeCapabilityRoute,
503502
resolvedAuth,

src/gateway/server.models-voicewake-misc.test.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ import {
2323
startConnectedServerWithClient,
2424
startGatewayServer,
2525
startServerWithClient,
26-
testState,
27-
testTailnetIPv4,
2826
trackConnectChallengeNonce,
2927
} from "./test-helpers.js";
3028

src/gateway/server/plugins-http/route-capability.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,11 @@ export function findMatchingPluginNodeCapabilityRoutes(
3434
): PluginNodeCapabilityRoute[] {
3535
return findMatchingPluginHttpRoutes(registry, context)
3636
.filter(hasNodeCapabilityRoute)
37-
.map((route) => ({
38-
...route,
39-
nodeCapability: resolvePluginNodeCapabilityRouteSurface(route),
40-
}));
37+
.map((route) =>
38+
Object.assign({}, route, {
39+
nodeCapability: resolvePluginNodeCapabilityRouteSurface(route),
40+
}),
41+
);
4142
}
4243

4344
export function findMatchingPluginNodeCapabilityRoute(

src/plugins/registry.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1293,18 +1293,17 @@ export function createPluginRegistry(registryParams: PluginRegistryParams) {
12931293
}
12941294
const serializeCommandPath = (command: string) => [...normalizedParentPath, command].join(" ");
12951295
const commandPaths = commands.map(serializeCommandPath);
1296+
const commandPathSet = new Set(commandPaths);
12961297
const existing = registry.cliRegistrars.find((entry) =>
12971298
entry.commands
12981299
.map((command) => [...(entry.parentPath ?? []), command].join(" "))
1299-
.some((commandPath) => commandPaths.includes(commandPath)),
1300+
.some((commandPath) => commandPathSet.has(commandPath)),
13001301
);
13011302
if (existing) {
1302-
const existingCommandPaths = existing.commands.map((command) =>
1303-
[...(existing.parentPath ?? []), command].join(" "),
1304-
);
1305-
const overlap = commandPaths.find((commandPath) =>
1306-
existingCommandPaths.includes(commandPath),
1303+
const existingCommandPaths = new Set(
1304+
existing.commands.map((command) => [...(existing.parentPath ?? []), command].join(" ")),
13071305
);
1306+
const overlap = commandPaths.find((commandPath) => existingCommandPaths.has(commandPath));
13081307
pushDiagnostic({
13091308
level: "error",
13101309
pluginId: record.id,

0 commit comments

Comments
 (0)