fix: clean up plugin linting and types

This commit is contained in:
Peter Steinberger
2026-02-01 15:38:18 -08:00
parent a87a07ec8a
commit 19775abdda
3 changed files with 6 additions and 4 deletions

View File

@@ -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",

View File

@@ -53,7 +53,7 @@ function resolveAccountConfig(
if (!accounts || typeof accounts !== "object") {
return undefined;
}
return accounts[accountId] as GoogleChatAccountConfig | undefined;
return accounts[accountId];
}
function mergeGoogleChatAccountConfig(

View File

@@ -347,9 +347,10 @@ export const linePlugin: ChannelPlugin<ResolvedLineAccount> = {
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<Record<string, unknown>>) => {
@@ -433,7 +434,7 @@ export const linePlugin: ChannelPlugin<ResolvedLineAccount> = {
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,
});