Write HTML. Render video. Built for agents.
JavaScript aiai-agentsanimationclaude-codeffmpegframeworkgsaphtmlhtml-to-videomcpmotion-graphicspuppeteerrenderingtypescriptvideo-editor
fix(lint): honor data-no-timeline on root compositions (#2228)
Miguel Ángelc18391b98c63
diff --git a/packages/lint/src/rules/core.test.ts b/packages/lint/src/rules/core.test.tsindex cf5e463e49..1419c545ee 100644--- a/packages/lint/src/rules/core.test.ts+++ b/packages/lint/src/rules/core.test.ts@@ -227,6 +227,15 @@ describe("core rules", () => {expect(finding).toBeDefined();});+ it("allows a timeline-free root that explicitly declares data-no-timeline", async () => {+ const html = `+<html><body>+ <div id="root" data-composition-id="c1" data-no-timeline data-width="1920" data-height="1080" data-duration="5"></div>+</body></html>`;+ const result = await lintHyperframeHtml(html);+ expect(result.findings.find((f) => f.code === "missing_timeline_registry")).toBeUndefined();+ });+it("does not flag missing_timeline_registry on a sub-composition (inherits from host)", async () => {const html = `<html><body>diff --git a/packages/lint/src/rules/core.ts b/packages/lint/src/rules/core.tsindex d297d4a761..f4b6b8a300 100644--- a/packages/lint/src/rules/core.ts+++ b/packages/lint/src/rules/core.ts@@ -264,11 +264,12 @@ export const coreRules: Array<(ctx: LintContext) => HyperframeLintFinding[]> = [},// missing_timeline_registry + timeline_registry_missing_init- ({ source, rawSource, options }) => {+ ({ source, rawSource, rootTag, options }) => {// Sub-compositions inherit window.__timelines from the host compositionif (options.isSubComposition || rawSource.trimStart().toLowerCase().startsWith("<template")) {return [];}+ if (/(?:^|\s)data-no-timeline(?=[\s=/]|$)/i.test(rootTag?.attrs || "")) return [];const findings: HyperframeLintFinding[] = [];if (!TIMELINE_REGISTRY_INIT_PATTERN.test(source) &&