@@ -36,13 +36,23 @@ var DOM_PROPERTY_NAMES = [
36
36
// ------------------------------------------------------------------------------
37
37
38
38
/**
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 .
41
41
* @returns {boolean } Whether or not the node name match the JSX tag convention.
42
42
*/
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 ;
46
56
}
47
57
48
58
/**
@@ -72,7 +82,7 @@ module.exports = function(context) {
72
82
73
83
JSXAttribute : function ( node ) {
74
84
var standardName = getStandardName ( node . name . name ) ;
75
- if ( ! isTagName ( node . parent . name . name ) || ! standardName ) {
85
+ if ( ! isTagName ( node ) || ! standardName ) {
76
86
return ;
77
87
}
78
88
context . report ( node , UNKNOWN_MESSAGE , {
0 commit comments