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-anb-no-unmatchable performance #7042

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/olive-candles-fry.md
@@ -0,0 +1,5 @@
---
"stylelint": patch
---

Fixed: `selector-anb-no-unmatchable` performance
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The previous improvement was released in 15.8.0.

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