Repository navigation
fix(lint): keep separate count-up objects apart in the repeated fromTo check - #7701
Open
wonjangcloud9 wants to merge 1 commit into
Open
wonjangcloud9 wants to merge 1 commit into
wonjangcloud9 wants to merge 1 commit into
Conversation
…o check
gsap_repeated_fromto_without_baseline grouped fromTo calls by the parser's
target label, and every plain-object tween without a DOM write is labelled
"proxy (unresolved DOM association)". Four independent count-up objects
(`const o = { v: 0 }` per counter) were reported as one target fromTo'd four
times. Group by the parser's target identity instead, which already tells
proxy declarations (and helper/loop instances) apart, and skip targets with no
stable identity, the same way overlapping_gsap_tweens does.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This branch has not been deployed
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.
What
gsap_repeated_fromto_without_baselineno longer reports several independent plain-object tweens (count-ups) as one target that isfromTo'd over and over. It groupsfromTocalls by the parser's target identity instead of its display label.Why
A chart scene had four count-up numbers, each driven by its own object through a small helper:
hyperframes lint/checkwarned:Those are four different objects, so no tween can leak its "from" values into another one. The rule keyed its groups on
targetSelector, and the parser gives every plain-object tween whoseonUpdateit cannot map to a DOM channel the same label,"proxy (unresolved DOM association)". The parser already tells these objects apart: it setstargetIdentity(proxy:<name>@<declaration>, plus the helper/loop call site for per-call objects).overlapping_gsap_tweensalready uses that identity and skips labels with no identity (targetHasNoStableIdentity). This rule did neither.Related work
How
packages/lint/src/rules/gsap.ts:targetKey(win)=win.targetIdentity ?? win.targetSelector. The fromTo groups and the earlier-tl.setbaseline lookup now comparetargetKey.targetHasNoStableIdentity:__unresolved__,dwell/hold, or aproxy …label without an identity) is skipped. The old code skipped only__unresolved__.DOM selectors have no
targetIdentity, so their grouping does not change. One object tweened by twofromTocalls still warns.Test plan
Unit (
packages/lint/src/rules/gsap.test.ts):keeps separate count-up objects apart: two named objects plus two per-call objects from a helper, no finding.still warns for one count-up object tweened twice: same object, twofromTo,2 tl.fromTo() calls.On main (
affa03b6) with the fix stashed,× gsap_repeated_fromto_without_baseline: keeps separate count-up objects apartfails (expected { …(6) } to be undefined). With the fix,packages/lintpasses all 27 files and 1311 tests.Real CLI on a repro (
index.htmlwithconst rev = { v: 0 },const loss = { v: 0 }and the helper above called twice):The original project (chart scene with four
count(...)calls) shows the same thing: main warns once forcompositions/chart.html, and this branch reports0 errors, 0 warnings.Gates: oxlint and oxfmt are clean.
fallow audit --base origin/mainreports no issues in the changed files. The comment ratchet and comment citations pass, and the lefthook typecheck passes.