Skip to content
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

Fix selector-pseudo-element-no-unknown performance #7007

Merged
merged 2 commits into from Jun 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/smooth-tigers-wink.md
@@ -0,0 +1,5 @@
---
"stylelint": patch
---

Fixed: `selector-pseudo-element-no-unknown` performance
8 changes: 4 additions & 4 deletions lib/rules/selector-pseudo-element-no-unknown/index.js
Expand Up @@ -42,10 +42,6 @@ const rule = (primary, secondaryOptions) => {
}

root.walkRules((ruleNode) => {
if (!isStandardSyntaxRule(ruleNode)) {
return;
}

const selector = ruleNode.selector;

// Return early before parse if no pseudos for performance
Expand All @@ -54,6 +50,10 @@ const rule = (primary, secondaryOptions) => {
return;
}

if (!isStandardSyntaxRule(ruleNode)) {
return;
}

parseSelector(selector, result, ruleNode, (selectorTree) => {
selectorTree.walkPseudos((pseudoNode) => {
const value = pseudoNode.value;
Expand Down