Changeset 0c6b92a for imaps-frontend/node_modules/eslint-plugin-react/lib/rules/no-invalid-html-attribute.js
Legend:
- Unmodified
- Added
- Removed
-
imaps-frontend/node_modules/eslint-plugin-react/lib/rules/no-invalid-html-attribute.js
rd565449 r0c6b92a 290 290 291 291 const singleAttributeParts = splitIntoRangedParts(node, /(\S+)/g); 292 for (const singlePart of singleAttributeParts){292 singleAttributeParts.forEach((singlePart) => { 293 293 const allowedTags = VALID_VALUES.get(attributeName).get(singlePart.value); 294 294 const reportingValue = singlePart.reportingValue; … … 330 330 }); 331 331 } 332 } 332 }); 333 333 334 334 const allowedPairsForAttribute = VALID_PAIR_VALUES.get(attributeName); 335 335 if (allowedPairsForAttribute) { 336 336 const pairAttributeParts = splitIntoRangedParts(node, /(?=(\b\S+\s*\S+))/g); 337 for (const pairPart of pairAttributeParts) { 338 for (const allowedPair of allowedPairsForAttribute) { 339 const pairing = allowedPair[0]; 340 const siblings = allowedPair[1]; 337 pairAttributeParts.forEach((pairPart) => { 338 allowedPairsForAttribute.forEach((siblings, pairing) => { 341 339 const attributes = pairPart.reportingValue.split('\u0020'); 342 340 const firstValue = attributes[0]; … … 358 356 } 359 357 } 360 } 361 } 358 }); 359 }); 362 360 } 363 361 364 362 const whitespaceParts = splitIntoRangedParts(node, /(\s+)/g); 365 for (const whitespacePart of whitespaceParts){363 whitespaceParts.forEach((whitespacePart) => { 366 364 const data = { attributeName }; 367 365 … … 387 385 }); 388 386 } 389 } 387 }); 390 388 } 391 389 … … 580 578 581 579 if (prop.value.type === 'ArrayExpression') { 582 for (const value of prop.value.elements){580 prop.value.elements.forEach((value) => { 583 581 checkPropValidValue(context, node, value, attribute); 584 } 582 }); 585 583 586 584 // eslint-disable-next-line no-continue … … 592 590 } 593 591 592 /** @type {import('eslint').Rule.RuleModule} */ 594 593 module.exports = { 595 594 meta: { … … 641 640 642 641 // ignore non-HTML elements 643 if ( !HTML_ELEMENTS.has(elemNameArg.value)) {642 if (typeof elemNameArg.value === 'string' && !HTML_ELEMENTS.has(elemNameArg.value)) { 644 643 return; 645 644 } … … 647 646 const attributes = new Set(context.options[0] || DEFAULT_ATTRIBUTES); 648 647 649 for (const attribute of attributes){648 attributes.forEach((attribute) => { 650 649 checkCreateProps(context, node, attribute); 651 } 650 }); 652 651 }, 653 652 };
Note:
See TracChangeset
for help on using the changeset viewer.