From 7e17c96c30cad158f9d4b50bd7d9dfc7ebc47165 Mon Sep 17 00:00:00 2001 From: Junyan Qin Date: Fri, 30 May 2025 22:29:16 +0800 Subject: [PATCH] fix: linter error --- .../components/bot-card/botCard.module.css | 2 +- .../dynamic-form/N8nAuthFormComponent.tsx | 20 +++++++++++-------- .../pipeline-card/pipelineCard.module.css | 2 +- web/src/app/infra/entities/api/index.ts | 8 ++++---- 4 files changed, 18 insertions(+), 14 deletions(-) diff --git a/web/src/app/home/bots/components/bot-card/botCard.module.css b/web/src/app/home/bots/components/bot-card/botCard.module.css index ea526c4e..396b5831 100644 --- a/web/src/app/home/bots/components/bot-card/botCard.module.css +++ b/web/src/app/home/bots/components/bot-card/botCard.module.css @@ -113,4 +113,4 @@ height: 100%; width: 3rem; gap: 0.4rem; -} \ No newline at end of file +} diff --git a/web/src/app/home/components/dynamic-form/N8nAuthFormComponent.tsx b/web/src/app/home/components/dynamic-form/N8nAuthFormComponent.tsx index f595fc7a..1c71befc 100644 --- a/web/src/app/home/components/dynamic-form/N8nAuthFormComponent.tsx +++ b/web/src/app/home/components/dynamic-form/N8nAuthFormComponent.tsx @@ -25,11 +25,11 @@ export default function N8nAuthFormComponent({ }: { itemConfigList: IDynamicFormItemSchema[]; onSubmit?: (val: object) => unknown; - initialValues?: Record; + initialValues?: Record; }) { // 当前选择的认证类型 const [authType, setAuthType] = useState( - initialValues?.['auth-type'] || 'none' + initialValues?.['auth-type'] || 'none', ); // 根据 itemConfigList 动态生成 zod schema @@ -111,7 +111,7 @@ export default function N8nAuthFormComponent({ acc[item.name] = initialValues[item.name] ?? item.default; return acc; }, - {} as Record, + {} as Record, ); Object.entries(mergedValues).forEach(([key, value]) => { @@ -119,7 +119,7 @@ export default function N8nAuthFormComponent({ }); // 更新认证类型 - setAuthType(mergedValues['auth-type'] as string || 'none'); + setAuthType((mergedValues['auth-type'] as string) || 'none'); } }, [initialValues, form, itemConfigList]); @@ -138,9 +138,9 @@ export default function N8nAuthFormComponent({ acc[item.name] = formValues[item.name] ?? item.default; return acc; }, - {} as Record, + {} as Record, ); - + onSubmit?.(finalValues); }); return () => subscription.unsubscribe(); @@ -149,7 +149,11 @@ export default function N8nAuthFormComponent({ // 根据认证类型过滤表单项 const filteredConfigList = itemConfigList.filter((config) => { // 始终显示webhook-url、auth-type、timeout和output-key - if (['webhook-url', 'auth-type', 'timeout', 'output-key'].includes(config.name)) { + if ( + ['webhook-url', 'auth-type', 'timeout', 'output-key'].includes( + config.name, + ) + ) { return true; } @@ -197,4 +201,4 @@ export default function N8nAuthFormComponent({ ); -} \ No newline at end of file +} diff --git a/web/src/app/home/pipelines/components/pipeline-card/pipelineCard.module.css b/web/src/app/home/pipelines/components/pipeline-card/pipelineCard.module.css index f0a2ffdc..34495441 100644 --- a/web/src/app/home/pipelines/components/pipeline-card/pipelineCard.module.css +++ b/web/src/app/home/pipelines/components/pipeline-card/pipelineCard.module.css @@ -97,4 +97,4 @@ font-size: 1.4rem; font-weight: bold; max-width: 100%; -} \ No newline at end of file +} diff --git a/web/src/app/infra/entities/api/index.ts b/web/src/app/infra/entities/api/index.ts index eb746272..fdd361d3 100644 --- a/web/src/app/infra/entities/api/index.ts +++ b/web/src/app/infra/entities/api/index.ts @@ -203,10 +203,10 @@ export interface MarketPluginResponse { } interface GetPipelineConfig { - ai: {}; - output: {}; - safety: {}; - trigger: {}; + ai: object; + output: object; + safety: object; + trigger: object; } interface GetPipeline {