Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions packages/lint/src/rules/gsap.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -584,6 +584,12 @@ describe("GSAP rules", () => {
const conflicts = result.findings.filter((f) => f.code === "gsap_css_transform_conflict");
expect(conflicts).toHaveLength(1);
expect(conflicts[0]?.message).toMatch(/x\/scale|scale\/x/);
// Regression: a single CSS declaration with both translate and scale must
// not produce doubled transform text in the message or fixHint (#3263).
const msg = conflicts[0]?.message ?? "";
const hint = conflicts[0]?.fixHint ?? "";
expect(msg).not.toContain("translateX(-50%) scale(0.8) translateX(-50%) scale(0.8)");
expect(hint).not.toContain("translateX(-50%) scale(0.8) translateX(-50%) scale(0.8)");
});

// --- Inline style transform detection tests ---
Expand Down
7 changes: 6 additions & 1 deletion packages/lint/src/rules/gsap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1352,8 +1352,13 @@ export const gsapRules: LintRule<LintContext>[] = [
const cssFromScale =
scaleProps.length > 0 ? matchCssTransform(sel, cssScaleSelectors) : undefined;
if (!cssFromTranslate && !cssFromScale) continue;
// When a single CSS declaration contains both translate and scale,
// both maps store the same transformVal for the same selector.
// Deduplicate to prevent doubled text in the finding message/fixHint.
const parts = [cssFromTranslate, cssFromScale].filter(Boolean);
const cssTransform = [...new Set(parts)].join(" ");
const existing = conflicts.get(sel) ?? {
cssTransform: [cssFromTranslate, cssFromScale].filter(Boolean).join(" "),
cssTransform,
props: new Set<string>(),
raw: call.raw,
};
Expand Down
Loading