Skip to content

Commit 5cb62c3

Browse files
author
Bart Veneman
committed
remove obsolete check for isA11y
1 parent a865b1b commit 5cb62c3

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

src/selectors/utils.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,12 @@ export function isAccessibility(selector) {
6060
isA11y = true
6161
return this.break
6262
}
63-
} else if (node.type == 'PseudoClassSelector') {
63+
}
64+
// Test for [aria-] or [role] inside :is()/:where() and friends
65+
else if (node.type == 'PseudoClassSelector') {
6466
if (isPseudoFunction(node.name)) {
6567
const list = analyzeList(node, isAccessibility)
6668

67-
// Bail out for empty/non-existent :nth-child() params
68-
if (list.length === 0) return
69-
7069
if (list.some(b => b == true)) {
7170
isA11y = true
7271
return this.skip
@@ -116,12 +115,12 @@ export function getComplexity(selector) {
116115

117116
if (node.type == 'PseudoClassSelector') {
118117
if (isPseudoFunction(node.name)) {
119-
const selectorList = analyzeList(node, getComplexity)
118+
const list = analyzeList(node, getComplexity)
120119

121120
// Bail out for empty/non-existent :nth-child() params
122-
if (selectorList.length === 0) return
121+
if (list.length === 0) return
123122

124-
selectorList.forEach(c => complexity += c)
123+
list.forEach(c => complexity += c)
125124
return this.skip
126125
}
127126
}

0 commit comments

Comments
 (0)