Repository navigation
fix(lint): point the repeated fromTo baseline hint at immediateRender: false - #3895
Merged
Merged
Conversation
…-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]>
…iateRender: false
miguel-heygen
force-pushed
the
fix/gsap-lint-baseline-hide-contradiction
branch
from
October 2, 2026 10:04
0f677b3 to
ebff022
Compare
Contributor
Edit accuracy: accurate 1216 (base branch 1216), smooth 1084 of thoseThe gate passes. Quarantined, measured but not gated (1)
|
This was referenced Nov 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
gsap_repeated_fromto_without_baselinetold authors to add an earliertl.set(sel, { ... }, 0)baseline. When those values hide the element,gsap_timeline_set_initial_hidethen flags that sametl.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, twofromToon 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: falseon 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 tripsgsap_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 --checkclean on both files.