Skip to content

Commit ae84151

Browse files
committed
minor comment addressed
1 parent 55ded2e commit ae84151

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

lib/rules/autocomplete-a11y-matches.js

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -81,17 +81,15 @@ function quantityField(node) {
8181
'data-placeholder',
8282
'role'
8383
];
84-
for (const attr of attributes) {
84+
return attributes.some(attr => {
8585
if (node.hasAttribute(attr)) {
8686
const value = node.getAttribute(attr).toLowerCase();
87-
for (const keyword of keywords) {
88-
if (value && value.includes(keyword.toLowerCase())) {
89-
return true;
90-
}
91-
}
87+
return keywords.some(
88+
keyword => value && value.includes(keyword.toLowerCase())
89+
);
9290
}
93-
}
94-
return false;
91+
return false;
92+
});
9593
}
9694

9795
function autocompleteA11yMatches(node, virtualNode) {

0 commit comments

Comments
 (0)