From 19775abdda11c4066c308752894fad156b9aeef4 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Sun, 1 Feb 2026 15:38:18 -0800 Subject: [PATCH] fix: clean up plugin linting and types --- .oxlintrc.json | 1 + extensions/googlechat/src/accounts.ts | 2 +- extensions/line/src/channel.ts | 7 ++++--- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.oxlintrc.json b/.oxlintrc.json index d5dfde5b4..fc873fc0d 100644 --- a/.oxlintrc.json +++ b/.oxlintrc.json @@ -15,6 +15,7 @@ "oxc/no-async-endpoint-handlers": "off", "oxc/no-map-spread": "off", "typescript/no-extraneous-class": "off", + "typescript/no-redundant-type-constituents": "off", "typescript/no-unnecessary-template-expression": "off", "typescript/no-unsafe-type-assertion": "off", "unicorn/consistent-function-scoping": "off", diff --git a/extensions/googlechat/src/accounts.ts b/extensions/googlechat/src/accounts.ts index c3210c35a..8a247d141 100644 --- a/extensions/googlechat/src/accounts.ts +++ b/extensions/googlechat/src/accounts.ts @@ -53,7 +53,7 @@ function resolveAccountConfig( if (!accounts || typeof accounts !== "object") { return undefined; } - return accounts[accountId] as GoogleChatAccountConfig | undefined; + return accounts[accountId]; } function mergeGoogleChatAccountConfig( diff --git a/extensions/line/src/channel.ts b/extensions/line/src/channel.ts index 780183c56..fd8f66835 100644 --- a/extensions/line/src/channel.ts +++ b/extensions/line/src/channel.ts @@ -347,9 +347,10 @@ export const linePlugin: ChannelPlugin = { const createQuickReplyItems = runtime.channel.line.createQuickReplyItems; let lastResult: { messageId: string; chatId: string } | null = null; - const hasQuickReplies = Boolean(lineData.quickReplies?.length); + const quickReplies = lineData.quickReplies ?? []; + const hasQuickReplies = quickReplies.length > 0; const quickReply = hasQuickReplies - ? createQuickReplyItems(lineData.quickReplies!) + ? createQuickReplyItems(quickReplies) : undefined; const sendMessageBatch = async (messages: Array>) => { @@ -433,7 +434,7 @@ export const linePlugin: ChannelPlugin = { for (let i = 0; i < chunks.length; i += 1) { const isLast = i === chunks.length - 1; if (isLast && hasQuickReplies) { - lastResult = await sendQuickReplies(to, chunks[i], lineData.quickReplies!, { + lastResult = await sendQuickReplies(to, chunks[i], quickReplies, { verbose: false, accountId: accountId ?? undefined, });