From c9a54854478868980347f3adf3deae9b98b01f43 Mon Sep 17 00:00:00 2001 From: gaokefei <260480378@qq.com> Date: Thu, 6 Jun 2024 01:35:35 +0800 Subject: [PATCH 1/2] fix(language-core): ignore type error for possible component name --- packages/language-core/lib/codegen/template/element.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/language-core/lib/codegen/template/element.ts b/packages/language-core/lib/codegen/template/element.ts index 6b49897f6f..f1698be587 100644 --- a/packages/language-core/lib/codegen/template/element.ts +++ b/packages/language-core/lib/codegen/template/element.ts @@ -117,6 +117,7 @@ export function* generateComponent( yield endOfLine; } else if (!isComponentTag) { + yield `// @ts-ignore${newLine}`; yield `const ${var_originalComponent} = ({} as `; for (const componentName of possibleOriginalNames) { yield `'${componentName}' extends keyof typeof __VLS_ctx ? { '${getCanonicalComponentName(node.tag)}': typeof __VLS_ctx`; From c8a357b677aa183b6505acba112a5e914f53fde9 Mon Sep 17 00:00:00 2001 From: gaokefei <260480378@qq.com> Date: Thu, 6 Jun 2024 01:58:01 +0800 Subject: [PATCH 2/2] fix: test --- packages/language-core/lib/codegen/template/element.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/language-core/lib/codegen/template/element.ts b/packages/language-core/lib/codegen/template/element.ts index f1698be587..cf98782890 100644 --- a/packages/language-core/lib/codegen/template/element.ts +++ b/packages/language-core/lib/codegen/template/element.ts @@ -124,7 +124,7 @@ export function* generateComponent( yield* generatePropertyAccess(options, ctx, componentName); yield ` }: `; } - yield `typeof __VLS_resolvedLocalAndGlobalComponents)`; + yield `typeof __VLS_resolvedLocalAndGlobalComponents)${newLine}`; yield* generatePropertyAccess( options, ctx,