-
-
Notifications
You must be signed in to change notification settings - Fork 32
feat: add new rule no-duplicate-keyframe-selectors
#143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
eslint.config.js
Outdated
| export default [ | ||
| { | ||
| ignores: ["**/tests/fixtures/", "**/dist/"], | ||
| ignores: ["**/tests/fixtures/", "**/dist/", "test.css"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added this test.css for local testing purposes, similar to the eslint repo
62ec302 to
470e3a9
Compare
|
@snitin315 can you check the merge conflicts? |
|
@nzakas resolved. |
eslint.config.js
Outdated
| { | ||
| files: ["**/*.css"], | ||
| language: "css/css", | ||
| ...css.configs.recommended, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we use extends here instead?
|
|
||
| create(context) { | ||
| return { | ||
| Atrule(node) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method is traversing the at-rule itself instead of letting the rule do so.
It would be more efficient to do "Atrule[name=keyframes]", "Atrule[name=keyframes]:exit" and then look for the selectors in between.
See https://github.com/eslint/css/blob/main/src/rules/use-layers.js as an example.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense, done.
|
@snitin315 Are you still working on this? |
|
Yes |
|
Hi @snitin315, There are a few merge conflicts. Whenever you have a chance, could you take a look? |
nzakas
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks.
Prerequisites checklist
What is the purpose of this pull request?
Add new rule
no-duplicate-keyframe-selectors.What changes did you make? (Give an overview)
Examples of incorrect code for this rule:
Examples of correct code for this rule:
Related Issues
Fix #141
Is there anything you'd like reviewers to focus on?