From 6a902ecb9b928bbd4cfdd10117b8246e27999e3a 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 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/rules/no-invalid-html-attribute.js b/lib/rules/no-invalid-html-attribute.js index e82c4c4316..f5103aa7b5 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)) {