Skip to content

fix(lint): point the repeated fromTo baseline hint at immediateRender: false - #3895

Merged
miguel-heygen merged 3 commits into
mainfrom
fix/gsap-lint-baseline-hide-contradiction
Oct 2, 2026
Merged

miguel-heygen merged 3 commits into
mainfrom
fix/gsap-lint-baseline-hide-contradiction

Conversation

@miga-heygen

@miga-heygen miga-heygen commented Sep 12, 2026 •

Copy link
Copy Markdown
Contributor

Summary

gsap_repeated_fromto_without_baseline told authors to add an earlier tl.set(sel, { ... }, 0) baseline. When those values hide the element, gsap_timeline_set_initial_hide then flags that same tl.set, so following one rule trips the other.

The first version of this PR resolved that by accepting a load-time gsap.set(...) authored before the fromTo calls. Measured against GSAP 3.15 (paused timeline, two fromTo on one target, seeking to 0, 2, 7 then 2, 12 then 2, 12 then 0), that shape behaves exactly like no baseline: at seek 0 and 2 the target shows the last fromTo's "from" values, because each fromTo's immediateRender overwrites the earlier set. Accepting it would have silenced a real leak, so the rule logic is unchanged here.

What this PR now does: the fix hint points at immediateRender: false on every fromTo except the earliest-positioned one (by timeline position, named in the hint), which also holds when the later tween is authored first. That shape was correct at every seek above, the rule already accepts it, and it never trips gsap_timeline_set_initial_hide. The hint also says why the two other shapes are traps.

Size

Hint text, two test assertions and one test for the hinted shape. The rule logic did not need to change; the conflict was in what the hint recommended.

Test plan

  • packages/lint/src/rules/gsap.test.ts: 187/187 pass. The "warns for repeated future fromTo state" test pins the new hint wording and fails against the previous hint (186 pass, 1 fail). A new test checks the rule accepts the hinted shape when the later-positioned tween is authored first.
  • oxfmt --check clean on both files.

miga-heygen and others added 2 commits October 2, 2026 02:57
…-time gsap.set() baseline

Its own fixHint recommended two fixes: `immediateRender: false`, or an
earlier in-timeline `tl.set(sel, {...}, 0)` baseline. That second option
collides with gsap_timeline_set_initial_hide, which independently warns on
exactly that shape whenever the values hide the element — the common
hide-until-reveal case both rules exist for. Following one rule's advice
trips the other.

gsap_timeline_set_initial_hide already treats a load-time `gsap.set(...)`
as a reliable baseline (it exempts `global` sets outright), but
gsap_repeated_fromto_without_baseline's own baseline check rejected any
`global` set unconditionally. Aligns the two: a preceding load-time
`gsap.set(...)` now satisfies the baseline check too, gated on a new
reliability scan (factored out of the existing hidden-selector scan) that
excludes a set deferred behind a callback or event handler, since the GSAP
parser flags any bare `gsap.set(...)` as load-time regardless of where it
sits in the AST. The fixHint now recommends the load-time route first and
cross-references the other rule.

Co-Authored-By: Miguel Ángel <[email protected]>
@miguel-heygen
miguel-heygen force-pushed the fix/gsap-lint-baseline-hide-contradiction branch from 0f677b3 to ebff022 Compare October 2, 2026 10:04
@miguel-heygen miguel-heygen changed the title fix(lint): stop gsap_repeated_fromto_without_baseline flagging a load-time gsap.set() baseline fix(lint): point the repeated fromTo baseline hint at immediateRender: false Oct 2, 2026
@github-actions

github-actions Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Edit accuracy: accurate 1216 (base branch 1216), smooth 1084 of those

The gate passes.
Smoothness is reported in the artifact, not gated. A case fails only if it fails 2 of 3 runs.

Quarantined, measured but not gated (1)

@miguel-heygen
miguel-heygen merged commit 1248639 into main Oct 2, 2026
165 checks passed
@miguel-heygen
miguel-heygen deleted the fix/gsap-lint-baseline-hide-contradiction branch October 2, 2026 12:06
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.

2 participants