diff --git a/.fallowrc.jsonc b/.fallowrc.jsonc index a79e4dfdba..e18c012f2d 100644 --- a/.fallowrc.jsonc +++ b/.fallowrc.jsonc @@ -384,6 +384,11 @@ "packages/studio/src/hooks/useGsapSelectionHandlers.ts", // gsapParser.ts: recast/babel GSAP writer — intentional duplication between // recast and acorn parallel implementations (pre-existing, moved from core). + // project.test.ts: pre-existing parallel fixtures with + // packages/cli/src/utils/lintProject.test.ts from when project linting + // lived in the cli package; this change only prepends new template-root + // tests, and the line shift makes fallow re-flag the old clone. + "packages/lint/src/project.test.ts", "packages/parsers/src/gsapParser.ts", // hfIds.ts: 7-line clone with sdk/engine/mutate.ts — pre-existing duplication // from when hfIds lived in packages/core/src/parsers/. Moving the file to the diff --git a/packages/lint/src/context.ts b/packages/lint/src/context.ts index 9638f3ac52..67c80b8175 100644 --- a/packages/lint/src/context.ts +++ b/packages/lint/src/context.ts @@ -1,11 +1,5 @@ import type { HyperframeLintFinding, HyperframeLinterOptions } from "./types"; -import { - parseHtmlStructure, - findRootTag, - collectCompositionIds, - readAttr, - stripHtmlComments, -} from "./utils"; +import { findRootTag, collectCompositionIds, readAttr, resolveRootStructure } from "./utils"; import type { OpenTag, ExtractedBlock } from "./utils"; export type { OpenTag, ExtractedBlock }; @@ -19,6 +13,7 @@ export type LintContext = { compositionIds: Set; rootTag: OpenTag | null; rootCompositionId: string | null; + isTemplateWrappedRoot: boolean; options: HyperframeLinterOptions; }; @@ -27,31 +22,7 @@ export type { HyperframeLintFinding }; export function buildLintContext(html: string, options: HyperframeLinterOptions = {}): LintContext { const rawSource = html || ""; - // Strip HTML comments before scanning so a commented-out