Skip to content

Commit

Permalink
Fix selector-pseudo-element-no-unknown performance (#7007)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeddy3 committed Jun 30, 2023
1 parent 354fbfd commit 518367a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
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

0 comments on commit 518367a

Please sign in to comment.