-
-
Notifications
You must be signed in to change notification settings - Fork 17
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
base: main
Are you sure you want to change the base?
Conversation
@@ -30,7 +31,7 @@ const eslintPluginTestsRecommendedConfig = | |||
|
|||
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

// @ts-ignore - prelude is a valid property | ||
const selector = child.prelude.children[0].children[0]; |
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.
I'm not sure why TS reports error here, it seems to be valid. AST

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.
We need to add conditions here to check the types
// @ts-ignore - prelude is a valid property | |
const selector = child.prelude.children[0].children[0]; | |
// @ts-ignore - prelude is a valid property | |
const selector = child.type === "Rule" && child.prelude.type === "SelectorList" && child.prelude.children[0].type === "Selector" && child.prelude.children[0].children[0]; |
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?