File tree 1 file changed +8
-1
lines changed
1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -227,7 +227,7 @@ function inspectAssignment(path, ctx){
227
227
228
228
function inspectDeclarator ( path , ctx ) {
229
229
const node = path . node ;
230
- if ( ! isFunctionExpressionOrArrow ( node . init ) ) {
230
+ if ( ! isFunctionExpressionOrArrow ( node . init ) && ! t . isClassExpression ( node . init ) ) {
231
231
return ;
232
232
}
233
233
@@ -270,10 +270,17 @@ function inspectClassMethod(path, ctx){
270
270
const ancestry = path . getAncestry ( ) ;
271
271
for ( var i = 0 ; i < ancestry . length ; i ++ ) {
272
272
let ancestor = ancestry [ i ] ;
273
+
273
274
if ( ancestor . isClassDeclaration ( ) ) {
274
275
addSuspect ( ancestor , ctx , ! annotation ) ;
275
276
return ;
276
277
}
278
+
279
+ if ( ancestor . isClassExpression ( ) ) {
280
+ // Add the variable declaration of the class as suspect
281
+ addSuspect ( ancestor . parentPath . parentPath , ctx , ! annotation ) ;
282
+ return ;
283
+ }
277
284
}
278
285
}
279
286
You can’t perform that action at this time.
0 commit comments