From 2d07abbf62ef00d20b56aad299d7d7f7ec0d3cf8 Mon Sep 17 00:00:00 2001 From: Bojiang Date: Fri, 6 Jun 2025 11:09:15 +0800 Subject: [PATCH] jiangbo91@huawei.com MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 静态检查修复 Signed-off-by: Bojiang Change-Id: I15c07f377b8c2fea01751febb39dc6d74c00d7ec --- compiler/src/component_map.ts | 4 ++-- compiler/src/external_component_map.ts | 2 +- compiler/src/performance.ts | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/compiler/src/component_map.ts b/compiler/src/component_map.ts index f99de2a42..3527b3e6d 100644 --- a/compiler/src/component_map.ts +++ b/compiler/src/component_map.ts @@ -80,7 +80,7 @@ function addExternalComponents(): void { } else { COMPONENT_MAP[extCompName] = EXTERNAL_COMPONENT_MAP[extCompName]; } - }) + }); } export const TRANSITION_COMMON_ATTRS: Set = new Set([ @@ -153,7 +153,7 @@ export const CUSTOM_BUILDER_PROPERTIES: Set = new Set(['background', 'bi export const CUSTOM_BUILDER_PROPERTIES_WITHOUTKEY: Set = new Set(['showUnit', 'create']); export const CUSTOM_BUILDER_CONSTRUCTORS: Set = new Set(['MenuItem', 'MenuItemGroup', 'Refresh', 'WaterFlow', 'Radio', 'Checkbox']); -(function initComponent() { +(function initComponent(): void { Object.keys(COMPONENT_MAP).forEach((componentName) => { INNER_COMPONENT_NAMES.add(componentName); JS_BIND_COMPONENTS.add(componentName); diff --git a/compiler/src/external_component_map.ts b/compiler/src/external_component_map.ts index 89b4f0924..8e05675ed 100644 --- a/compiler/src/external_component_map.ts +++ b/compiler/src/external_component_map.ts @@ -31,7 +31,7 @@ export function readExternalComponents(): object { return EXT_COMPONENT_MAP; } for (const componentPath of componentPaths) { - if(!fs.existsSync(componentPath)){ + if (!fs.existsSync(componentPath)) { continue; } const files: string[] = fs.readdirSync(componentPath); diff --git a/compiler/src/performance.ts b/compiler/src/performance.ts index fea60b4ce..9b8e99707 100644 --- a/compiler/src/performance.ts +++ b/compiler/src/performance.ts @@ -105,7 +105,7 @@ export function processExternalEvents(projectConfig: Object, eventType: number, const isTsc: boolean = isTscEvents(eventType); const { parentEvent, filePath } = externalEventsInfo; let events: Event[] = isTsc ? ts.PerformanceDotting.getEventData() : - (fs.existsSync(filePath) ? JSON.parse(fs.readFileSync(filePath, 'utf-8')): []); + (fs.existsSync(filePath) ? JSON.parse(fs.readFileSync(filePath, 'utf-8')) : []); if (events && events.length) { events = events.sort((a, b) => a.startTime - b.startTime); asyncEvents.set(isTsc ? events[0].parentId : events[0].parentEvent, parentEvent); @@ -127,7 +127,7 @@ function setTotalTime(event: Event, isTsc: boolean): void { subEvent.start(); subEvent.stop(); subEvent.setTotalTime(event.duration); - asyncEvents.set(isTsc ? event.id : event.name, subEvent) + asyncEvents.set(isTsc ? event.id : event.name, subEvent); } } -- Gitee