Skip to content

Commit f82a24a

Browse files
authoredJul 4, 2023
Fix selector-anb-no-unmatchable performance (#7042)
1 parent 16110fd commit f82a24a

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed
 

‎.changeset/olive-candles-fry.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"stylelint": patch
3+
---
4+
5+
Fixed: `selector-anb-no-unmatchable` performance

‎lib/rules/selector-anb-no-unmatchable/index.js

+3-5
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,11 @@ const rule = (primary) => {
4646
}
4747

4848
root.walkRules((ruleNode) => {
49-
if (!isStandardSyntaxRule(ruleNode)) {
50-
return;
51-
}
49+
if (!hasANPlusBNotationPseudoClasses(ruleNode.selector)) return;
5250

53-
ruleNode.selectors.forEach((selector) => {
54-
if (!hasANPlusBNotationPseudoClasses(selector)) return;
51+
if (!isStandardSyntaxRule(ruleNode)) return;
5552

53+
ruleNode.selectors.forEach((selector) => {
5654
let cssTreeSelector;
5755

5856
try {

0 commit comments

Comments
 (0)
Please sign in to comment.