Skip to content

fix(lint): flag repeated fromTo state leaks - #3699

Open
miguel-heygen wants to merge 2 commits into
mainfrom
magi/fix-fromto-immediate-render
Open

fix(lint): flag repeated fromTo state leaks#3699
miguel-heygen wants to merge 2 commits into
mainfrom
magi/fix-fromto-immediate-render

Conversation

@miguel-heygen

@miguel-heygen miguel-heygen commented Sep 5, 2026

Copy link
Copy Markdown
Collaborator

What

Lint now warns when repeated future fromTo calls can leak the last authored start state into earlier frames. Explicit immediateRender: false and an earlier timeline baseline remain clean.

Why

GSAP applies default fromTo start values while the timeline is built, before the tween's scheduled position. When several calls target the same element, the last authored start state can become visible before the first tween, while existing lint reports no cause.

A standalone gsap.set is not accepted as proof of safety. An earlier global set can be overwritten by later fromTo construction, and a set for unrelated properties does not establish the affected state. The warning therefore clears only for explicit opt-out or an earlier tl.set baseline that participates in deterministic timeline seeking.

How

  • Preserve immediateRender as explicit true, explicit false, or the GSAP method default.
  • Group default or explicitly immediate-rendered fromTo writers by stable selector.
  • Require an earlier timeline set for that selector, or explicit immediateRender: false on the repeated writers.
  • Keep render seeking and GSAP runtime behavior unchanged.

Test plan

  • GSAP lint suite: 175 tests passed.
  • Regression cases cover omitted options, explicit false, earlier timeline baseline, earlier standalone set, unrelated standalone properties, later standalone set, deferred callback set, and late timeline baseline.
  • Lint package typecheck passed.
  • Changed-file oxlint, formatting, and diff checks passed.
  • Manual testing performed (not applicable; lint-only behavior).
  • Documentation updated (not applicable).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant