Skip to content

Commit

Permalink
Fix selector-anb-no-unmatchable performance (#7042)
Browse files Browse the repository at this point in the history
  • Loading branch information
romainmenke committed Jul 4, 2023
1 parent 16110fd commit f82a24a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .changeset/olive-candles-fry.md
@@ -0,0 +1,5 @@
---
"stylelint": patch
---

Fixed: `selector-anb-no-unmatchable` performance
8 changes: 3 additions & 5 deletions lib/rules/selector-anb-no-unmatchable/index.js
Expand Up @@ -46,13 +46,11 @@ const rule = (primary) => {
}

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

ruleNode.selectors.forEach((selector) => {
if (!hasANPlusBNotationPseudoClasses(selector)) return;
if (!isStandardSyntaxRule(ruleNode)) return;

ruleNode.selectors.forEach((selector) => {
let cssTreeSelector;

try {
Expand Down

0 comments on commit f82a24a

Please sign in to comment.