@@ -44,7 +44,7 @@ module.exports = {
44
44
return {
45
45
46
46
// pick up all imports at body entry time, to properly respect hoisting
47
- ' Program' : function ( { body } ) {
47
+ Program : function ( { body } ) {
48
48
function processBodyStatement ( declaration ) {
49
49
if ( declaration . type !== 'ImportDeclaration' ) return
50
50
@@ -83,7 +83,7 @@ module.exports = {
83
83
} ,
84
84
85
85
// same as above, but does not add names to local map
86
- ' ExportNamespaceSpecifier' : function ( namespace ) {
86
+ ExportNamespaceSpecifier : function ( namespace ) {
87
87
var declaration = importDeclaration ( context )
88
88
89
89
var imports = Exports . get ( declaration . source . value , context )
@@ -102,7 +102,7 @@ module.exports = {
102
102
103
103
// todo: check for possible redefinition
104
104
105
- ' MemberExpression' : function ( dereference ) {
105
+ MemberExpression : function ( dereference ) {
106
106
if ( dereference . object . type !== 'Identifier' ) return
107
107
if ( ! namespaces . has ( dereference . object . name ) ) return
108
108
@@ -146,7 +146,7 @@ module.exports = {
146
146
147
147
} ,
148
148
149
- ' VariableDeclarator' : function ( { id, init } ) {
149
+ VariableDeclarator : function ( { id, init } ) {
150
150
if ( init == null ) return
151
151
if ( init . type !== 'Identifier' ) return
152
152
if ( ! namespaces . has ( init . name ) ) return
@@ -193,6 +193,17 @@ module.exports = {
193
193
194
194
testKey ( id , namespaces . get ( init . name ) )
195
195
} ,
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
+ } ,
196
207
}
197
208
} ,
198
209
}
0 commit comments