Skip to content

feat(lint): flag a set that fires inside a running tween on the same property - #7059

Merged
miguel-heygen merged 2 commits into
mainfrom
feat/lint-same-property-tween-overlap
Nov 3, 2026
Merged

miguel-heygen merged 2 commits into
mainfrom
feat/lint-same-property-tween-overlap

Conversation

@miguel-heygen

Copy link
Copy Markdown
Collaborator

What

overlapping_gsap_tweens now also flags a tl.set() that fires while a tween on the same element and property is still running. The message names the element, the property, the set's time and the tween's window; the fix hint says to let the tween finish before the set fires.

Why

The rule skipped any zero-length window, so a set (zero duration) was never compared with a running tween. That is the shape of a one-word lyric's pop-in (fromTo opacity 0 to 1 over 0.16 s) followed by a hide (set opacity 0) one frame before it ends. Played in order the set wins; seeked, as scrub and export do frame by frame, the tween can win, so the old word stays on screen.

Two tweens with a duration are compared exactly as before. A set at or after the tween's end, at its first frame, on another property, or on another element is not reported.

Testing

fails without the fix: packages/lint/src/rules/gsap.test.ts > "a set that fires inside a running tween on the same property" > "reports a hide that lands in a pop-in's last frames, naming the element and both times"

On the devbox: the lint package's tests pass with the change; with the old gsap.ts the new test fails (1 failed, 235 passed). Linting all 756 HTML files under registry/, skills/ and examples/ gives the same 35 overlapping_gsap_tweens findings before and after, so no new false positive.

Size

A small helper and a rewritten loop in one rule, with its tests; it has no other carrier.

@heygengenesis heygengenesis Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving at ea210de5. I found no blocker.

Checked:

  • Fails without the fix: with the base gsap.ts (d03bdeae9), the named test fails (1 failed / 235 passed). At head, gsap.test.ts passes 236/236.
  • False positives: I linted all 756 HTML files under registry/, skills/ and examples/ before and after the change. Both runs give 35 overlapping_gsap_tweens findings, and none of them is a new set-inside-tween finding, which matches the PR body.
  • windowOverlap: two tweens that both have a duration are compared the same way as before. A set is reported only when it lands strictly inside the other tween's window, so a set at the tween's first frame or at its end isn't reported. Two sets are never compared. The overwrite: "auto" and unresolved-target skips still run first. No other rule reports the same case, so nothing is flagged twice.

Nit (not blocking): a set inside a repeat: -1 tween on the same property has running.end === Infinity, so the message reads …to Infinitys and the hint says move the set to Infinitys or later. That case is a real conflict, so the warning itself is correct. You could word the infinite case differently in a follow-up.

@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Edit accuracy: accurate 267 (base branch 267), smooth 110 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 (8)

@miguel-heygen
miguel-heygen added this pull request to the merge queue Nov 3, 2026
Merged via the queue into main with commit 5e30bbd Nov 3, 2026
82 checks passed
@miguel-heygen
miguel-heygen deleted the feat/lint-same-property-tween-overlap branch November 3, 2026 03:00
@jrusso1020 jrusso1020 mentioned this pull request Nov 3, 2026
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