@@ -44,7 +44,7 @@ module.exports = {
4444 return {
4545
4646 // pick up all imports at body entry time, to properly respect hoisting
47- ' Program' : function ( { body } ) {
47+ Program : function ( { body } ) {
4848 function processBodyStatement ( declaration ) {
4949 if ( declaration . type !== 'ImportDeclaration' ) return
5050
@@ -83,7 +83,7 @@ module.exports = {
8383 } ,
8484
8585 // same as above, but does not add names to local map
86- ' ExportNamespaceSpecifier' : function ( namespace ) {
86+ ExportNamespaceSpecifier : function ( namespace ) {
8787 var declaration = importDeclaration ( context )
8888
8989 var imports = Exports . get ( declaration . source . value , context )
@@ -102,7 +102,7 @@ module.exports = {
102102
103103 // todo: check for possible redefinition
104104
105- ' MemberExpression' : function ( dereference ) {
105+ MemberExpression : function ( dereference ) {
106106 if ( dereference . object . type !== 'Identifier' ) return
107107 if ( ! namespaces . has ( dereference . object . name ) ) return
108108
@@ -146,7 +146,7 @@ module.exports = {
146146
147147 } ,
148148
149- ' VariableDeclarator' : function ( { id, init } ) {
149+ VariableDeclarator : function ( { id, init } ) {
150150 if ( init == null ) return
151151 if ( init . type !== 'Identifier' ) return
152152 if ( ! namespaces . has ( init . name ) ) return
@@ -193,6 +193,17 @@ module.exports = {
193193
194194 testKey ( id , namespaces . get ( init . name ) )
195195 } ,
196+
197+ JSXMemberExpression : function ( { object, property} ) {
198+ if ( ! namespaces . has ( object . name ) ) return
199+ var namespace = namespaces . get ( object . name )
200+ if ( ! namespace . has ( property . name ) ) {
201+ context . report ( {
202+ node : property ,
203+ message : makeMessage ( property , [ object . name ] ) ,
204+ } )
205+ }
206+ } ,
196207 }
197208 } ,
198209}
0 commit comments