diff --git a/lib/rules/no-unknown-property.js b/lib/rules/no-unknown-property.js index 5d03286fb7..cc881a8a3b 100644 --- a/lib/rules/no-unknown-property.js +++ b/lib/rules/no-unknown-property.js @@ -167,6 +167,20 @@ function getTagName(node) { return null; } +/** + * Test wether the tag name for the JSXAttribute is + * something like + * @param {JSXAttribute} node - JSXAttribute being tested. + * @returns {Boolean} result + */ +function tagNameHasDot(node) { + return !!( + node.parent && + node.parent.name && + node.parent.name.type === 'JSXMemberExpression' + ); +} + /** * Get the standard name of the attribute. * @param {String} name - Name of the attribute. @@ -231,6 +245,11 @@ module.exports = { return; } + // Ignore tags like + if (tagNameHasDot(node)) { + return; + } + const tagName = getTagName(node); const allowedTags = ATTRIBUTE_TAGS_MAP[name]; if (tagName && allowedTags && /[^A-Z]/.test(tagName.charAt(0)) && allowedTags.indexOf(tagName) === -1) { diff --git a/tests/lib/rules/no-unknown-property.js b/tests/lib/rules/no-unknown-property.js index ea94c86717..65fd9dcb16 100644 --- a/tests/lib/rules/no-unknown-property.js +++ b/tests/lib/rules/no-unknown-property.js @@ -29,6 +29,7 @@ ruleTester.run('no-unknown-property', rule, { valid: [ {code: ';'}, {code: ';'}, + {code: ';'}, {code: ';'}, {code: ';'}, {code: ';'},