Write HTML. Render video. Built for agents.
JavaScript aiai-agentsanimationclaude-codeffmpegframeworkgsaphtmlhtml-to-videomcpmotion-graphicspuppeteerrenderingtypescriptvideo-editor
fix(lint): catch fromTo from-object layout/reflow props in gsap_non_transform_motion
Vance Ingalls189d8582f46d
diff --git a/packages/lint/src/rules/gsap.test.ts b/packages/lint/src/rules/gsap.test.tsindex 85089e8ebd..e452a20e3a 100644--- a/packages/lint/src/rules/gsap.test.ts+++ b/packages/lint/src/rules/gsap.test.ts@@ -1499,6 +1499,22 @@ describe("GSAP rules", () => {expect(finding).toBeDefined();});+ it("gsap_non_transform_motion: fires on a layout/reflow prop that appears only in a fromTo's from-object", async () => {+ const html = `+<html><body>+ <div data-composition-id="c1" data-width="1920" data-height="1080"><div id="t"></div></div>+ <script>+ window.__timelines = window.__timelines || {};+ const tl = gsap.timeline({ paused: true });+ tl.fromTo("#t", { left: 100, letterSpacing: "0.3em" }, { opacity: 1, duration: 1 }, 0);+ window.__timelines["c1"] = tl;+ </script>+</body></html>`;+ const result = await lintHyperframeHtml(html);+ const finding = result.findings.find((f) => f.code === "gsap_non_transform_motion");+ expect(finding).toBeDefined();+ });+it("gsap_non_transform_motion: fires on text-reflow props (letterSpacing / fontSize)", async () => {const html = `<html><body>diff --git a/packages/lint/src/rules/gsap.ts b/packages/lint/src/rules/gsap.tsindex baf00a15f6..0fa1e8261c 100644--- a/packages/lint/src/rules/gsap.ts+++ b/packages/lint/src/rules/gsap.ts@@ -4,6 +4,9 @@ interface LintParsedGsap {method: string;position: number | string;properties: Record<string, number | string>;+ // fromTo() exposes its first ("from") vars object separately; a layout/reflow prop+ // that appears only here still animates and must be checked.+ fromProperties?: Record<string, number | string>;duration?: number;ease?: string;extras?: Record<string, unknown>;@@ -1198,7 +1201,14 @@ export const gsapRules: LintRule<LintContext>[] = [...parsed.animations.map((anim) => ({method: anim.method,selector: anim.targetSelector,- properties: Object.keys(anim.properties),+ // Union the from-vars: a fromTo() can animate a layout/reflow prop that appears+ // only in its first ("from") object, which is just as stutter-prone as the to-vars.+ properties: [+ ...new Set([+ ...Object.keys(anim.properties),+ ...Object.keys(anim.fromProperties ?? {}),+ ]),+ ],raw: synthesizeWindowRaw(parsed.timelineVar, anim),})),...extractStandaloneGsapTransformCalls(stripJsComments(script.content)),