From 5f49f51dd237dd4c6758bc0c3e5b300a28770966 Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Mon, 17 Jan 2022 15:44:50 -0800 Subject: [PATCH] [Fix] `no-invalid-html-attribute`: avoid breaking syntax from #3174 --- lib/rules/no-invalid-html-attribute.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/rules/no-invalid-html-attribute.js b/lib/rules/no-invalid-html-attribute.js index e82c4c4316..cdba56a66d 100644 --- a/lib/rules/no-invalid-html-attribute.js +++ b/lib/rules/no-invalid-html-attribute.js @@ -306,9 +306,12 @@ function checkLiteralValueNode(context, attributeName, node, parentNode, parentN if (allowedPairsForAttribute) { const pairAttributeParts = splitIntoRangedParts(node, /(?=(\b\S+\s*\S+))/g); for (const pairPart of pairAttributeParts) { - for (const [pairing, siblings] of allowedPairsForAttribute) { + for (const allowedPair of allowedPairsForAttribute) { + const pairing = allowedPair[0]; + const siblings = allowedPair[1]; const attributes = pairPart.reportingValue.split('\u0020'); - const [firstValue, secondValue] = attributes; + const firstValue = attributes[0]; + const secondValue = attributes[1]; if (firstValue === pairing) { const lastValue = attributes[attributes.length - 1]; // in case of multiple white spaces if (!siblings.has(lastValue)) { @@ -319,7 +322,7 @@ function checkLiteralValueNode(context, attributeName, node, parentNode, parentN data: { reportingValue: firstValue, secondValue, - missingValue: [...siblings].join(', '), + missingValue: Array.from(siblings).join(', '), }, }); }