fix(astro): the component name heuristic applies to .astro files only (#2245)

Astro components are used in Astro markup; a .ts / .d.ts type name sharing a
component's name (Playwright's Page, a declaration file's Image) is no
component.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Colby Mchenry
2026-10-01 04:05:02 +00:00
committed by GitHub
co-authored by Claude Opus 5.5
parent 000c986276
commit b2afa75f08
3 changed files with 59 additions and 0 deletions
+3
View File
@@ -74,7 +74,10 @@ export const astroResolver: FrameworkResolver = {
// Pattern 3: Component references (PascalCase) — resolve to component
// nodes. Template tags arrive as `references`, frontmatter expression
// usages as `calls`.
// Only from Astro markup: a `.ts` file's `Page` (Playwright's) or a
// declaration file's `image?: Image` is no `Page.astro` / `Image.astro`.
if (
ref.filePath.endsWith('.astro') &&
isPascalCase(ref.referenceName) &&
(ref.referenceKind === 'references' || ref.referenceKind === 'calls')
) {