Skip to content

fix: update duplicate checking script regex and deduplication logic#1308

Merged
SAPTARSHI-coder merged 1 commit into
SAPTARSHI-coder:mainfrom
KRUSHAL2956:bugfix/duplicate-checker-selectors
Jun 4, 2026
Merged

fix: update duplicate checking script regex and deduplication logic#1308
SAPTARSHI-coder merged 1 commit into
SAPTARSHI-coder:mainfrom
KRUSHAL2956:bugfix/duplicate-checker-selectors

Conversation

@KRUSHAL2956
Copy link
Copy Markdown
Contributor

Pull Request Description

Closes #1291. Upgrades the regular expression and logic inside scripts/check-duplicates.mjs to correctly match:

  1. Indented class definitions (e.g. inside media queries).
  2. Classes with pseudo-classes (e.g. :hover, :active, :focus-visible).
  3. Grouped class selectors (e.g. .class1, .class2).

To prevent false duplicate detections from multiple states/rules in the same file (such as .ease-btn, .ease-btn:hover, and .ease-btn:active all residing inside components/buttons.css), the script now deduplicates class name definitions at the file level. A class name is only flagged as a duplicate if it is defined across multiple different files in the core and components directories.


Type of Change

  • ✨ New animation / hover effect
  • 🧩 New component
  • 📝 Documentation improvement
  • 🐛 Bug fix in an existing submission (duplicate checker script and its baseline config)
  • Other

Submission Checklist

⚠️ PRs that fail this checklist will be closed without review.
Note: This checklist is geared towards new community example submissions. Since this is a tooling/maintenance bug fix resolving an open issue (#1291), changes to scripts/ are required.

  • All changes are inside submissions/examples/your-feature-name/
  • Includes demo.html — self-contained, opens in browser with no server
  • Includes style.css — raw CSS for the proposed feature
  • Includes README.md — what it does, how to use it, why it fits EaseMotion CSS
  • No changes to core/
  • No changes to components/
  • One feature per PR (no bundled unrelated changes)

Feature Description

What does this add?

It improves the duplicate detector script to recognize indented selectors, pseudo-classes, and grouped selectors, while ignoring multiple declarations of the same class in a single file.


Notes for Maintainer

All styles have been validated using npm run lint and all unit tests pass.
The baseline configuration was updated to reflect the cross-file duplicate ease-btn-hover which is defined in both core/animations.css and components/buttons.css (the latter overrides the transition when inside preferred reduced motion settings).

@SAPTARSHI-coder SAPTARSHI-coder added accepted Contribution approved for integration into EaseMotion CSS animation Animation effects, hover interactions, motion ideas, transitions component New UI components (buttons, cards, modals, tooltips, badges) enhancement New feature or request good first issue Good for newcomers GSSoC-26 Official GSSoC 2026 issue gssoc:approved Approved for GSSoC contributions integrated Successfully merged and included in the framework level:intermediate Requires moderate project understanding type:feature New functionality or enhancement labels Jun 4, 2026
@SAPTARSHI-coder SAPTARSHI-coder merged commit 78ec85c into SAPTARSHI-coder:main Jun 4, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

accepted Contribution approved for integration into EaseMotion CSS animation Animation effects, hover interactions, motion ideas, transitions component New UI components (buttons, cards, modals, tooltips, badges) enhancement New feature or request good first issue Good for newcomers gssoc:approved Approved for GSSoC contributions GSSoC-26 Official GSSoC 2026 issue integrated Successfully merged and included in the framework level:intermediate Requires moderate project understanding type:feature New functionality or enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🐛 Bug: Duplicate Checker Script misses Indented and Pseudo-Classes

2 participants