Skip to content

Conversation

thecalamiity
Copy link
Contributor

@thecalamiity thecalamiity commented Sep 3, 2025

Prerequisites checklist

What rule do you want to change?

no-duplicate-keyframe-selectors

What change do you want to make?

Generate more warnings

How do you think the change should be implemented?

A new default behavior

Example code

@keyframes test {
      0% { opacity: 0; }
      0% { opacity: 1; }
 }
 
@-webkit-keyframes test {
      0% { opacity: 0; }
      0% { opacity: 1; }
 }

What does the rule currently do for this code?

It only detects duplicate keyframe selectors in unprefixed @keyframes blocks. Prefixed blocks like @-webkit-keyframes, @-moz-keyframes, or @-o-keyframes are ignored, so duplicates there are not reported.

What will the rule do after it's changed?

It will also detect duplicate keyframe selectors in vendor-prefixed @keyframes blocks, ensuring duplicates are reported consistently across prefixed and unprefixed animations.

What changes did you make? (Give an overview)

  • Broadened Atrule matchers (enter/exit) to use: /^(-(o|moz|webkit)-)?keyframes$/i
  • Add tests to ensure detection works for prefixed forms.

Related Issues

Is there anything you'd like reviewers to focus on?

@github-project-automation github-project-automation bot moved this to Needs Triage in Triage Sep 3, 2025
@eslint-github-bot eslint-github-bot bot added the bug Something isn't working label Sep 3, 2025
@nzakas
Copy link
Member

nzakas commented Sep 3, 2025

Thanks for the PR. Because this is also a bug report, can you please update the description with the same fields as the bug report issue template?

@nzakas nzakas moved this from Needs Triage to Triaging in Triage Sep 3, 2025
@thecalamiity
Copy link
Contributor Author

Sorry about that. Updated now.

Copy link
Member

@nzakas nzakas left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks!

@nzakas nzakas merged commit 11ae50f into eslint:main Sep 5, 2025
22 checks passed
@github-project-automation github-project-automation bot moved this from Triaging to Complete in Triage Sep 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working contributor pool
Projects
Status: Complete
Development

Successfully merging this pull request may close these issues.

2 participants