@@ -36,13 +36,23 @@ var DOM_PROPERTY_NAMES = [
3636// ------------------------------------------------------------------------------
3737
3838/**
39- * Checks if a node name match the JSX tag convention.
40- * @param {String } name - Name of the node to check .
39+ * Checks if a node matches the JSX tag convention.
40+ * @param {Object } node - JSX element being tested .
4141 * @returns {boolean } Whether or not the node name match the JSX tag convention.
4242 */
43- var tagConvention = / ^ [ a - z ] | \- / ;
44- function isTagName ( name ) {
45- return tagConvention . test ( name ) ;
43+ var tagConvention = / ^ [ a - z ] [ ^ - ] * $ / ;
44+ function isTagName ( node ) {
45+ if ( tagConvention . test ( node . parent . name . name ) ) {
46+ // http://www.w3.org/TR/custom-elements/#type-extension-semantics
47+ return ! node . parent . attributes . some ( function ( attrNode ) {
48+ return (
49+ attrNode . type === 'JSXAttribute' &&
50+ attrNode . name . type === 'JSXIdentifier' &&
51+ attrNode . name . name === 'is'
52+ ) ;
53+ } ) ;
54+ }
55+ return false ;
4656}
4757
4858/**
@@ -72,7 +82,7 @@ module.exports = function(context) {
7282
7383 JSXAttribute : function ( node ) {
7484 var standardName = getStandardName ( node . name . name ) ;
75- if ( ! isTagName ( node . parent . name . name ) || ! standardName ) {
85+ if ( ! isTagName ( node ) || ! standardName ) {
7686 return ;
7787 }
7888 context . report ( node , UNKNOWN_MESSAGE , {
0 commit comments