Skip to content

Commit 5f49f51

Browse files
committed
[Fix] no-invalid-html-attribute: avoid breaking syntax from #3174
1 parent 2445dbb commit 5f49f51

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

lib/rules/no-invalid-html-attribute.js

+6-3
Original file line numberDiff line numberDiff line change
@@ -306,9 +306,12 @@ function checkLiteralValueNode(context, attributeName, node, parentNode, parentN
306306
if (allowedPairsForAttribute) {
307307
const pairAttributeParts = splitIntoRangedParts(node, /(?=(\b\S+\s*\S+))/g);
308308
for (const pairPart of pairAttributeParts) {
309-
for (const [pairing, siblings] of allowedPairsForAttribute) {
309+
for (const allowedPair of allowedPairsForAttribute) {
310+
const pairing = allowedPair[0];
311+
const siblings = allowedPair[1];
310312
const attributes = pairPart.reportingValue.split('\u0020');
311-
const [firstValue, secondValue] = attributes;
313+
const firstValue = attributes[0];
314+
const secondValue = attributes[1];
312315
if (firstValue === pairing) {
313316
const lastValue = attributes[attributes.length - 1]; // in case of multiple white spaces
314317
if (!siblings.has(lastValue)) {
@@ -319,7 +322,7 @@ function checkLiteralValueNode(context, attributeName, node, parentNode, parentN
319322
data: {
320323
reportingValue: firstValue,
321324
secondValue,
322-
missingValue: [...siblings].join(', '),
325+
missingValue: Array.from(siblings).join(', '),
323326
},
324327
});
325328
}

0 commit comments

Comments
 (0)