fix(lint): quote a combined scale+translate declaration once - #3435
Open
rajanpanth wants to merge 1 commit into
Open
fix(lint): quote a combined scale+translate declaration once#3435rajanpanth wants to merge 1 commit into
rajanpanth wants to merge 1 commit into
Conversation
gsap_css_transform_conflict looks the selector up in the translate map
and the scale map separately, then joins both results. A single
declaration such as `transform: scale(1.08) translate3d(1.5%, 0, 0)`
matches both maps, so the two lookups return the same text and the
join repeated it:
".scene-1" has CSS `transform: scale(1.08) translate3d(1.5%, 0, 0)
scale(1.08) translate3d(1.5%, 0, 0)` and a GSAP tween animates
x/scale.
The same doubling appeared in fixHint. Dedupe the two lookups before
joining, which leaves the separate-declaration case unchanged.
Fixes heygen-com#3263
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.
Fixes #3263
Problem
gsap_css_transform_conflictlooks the selector up in the translate map and the scale map separately, then joins whatever both return:When a single declaration contains both functions, such as
transform: scale(1.08) translate3d(1.5%, 0, 0), it matches both selector maps. The two lookups then return the identical string and the join concatenates it with itself:The same doubling appeared in
fixHint, which told the user to remove the doubled text from their CSS.Fix
Dedupe the two lookups before joining:
The case this join exists for, a selector carrying translate and scale in two separate declarations, is untouched: those lookups return different strings, so the Set keeps both and they still join with a space.
Output for the issue's repro is now:
Testing
Added a case to
gsap.test.tsusing the composition from the issue, asserting the declaration appears exactly once in bothmessageandfixHint.Reverting the source line while keeping the test fails it, so it covers the change rather than restating current behaviour.
bunx vitest run packages/lint/srcpasses at 518 tests across 14 files with no pre-existing failures, andbunx oxlint/bunx oxfmt --checkare clean on both files.Note for anyone reproducing:
packages/linttests needbun run --filter '@hyperframes/parsers' buildfirst, otherwise the suite fails to collect on the@hyperframes/parsers/color-grading-contractsubpath import inrules/media.ts.