File tree 1 file changed +3
-6
lines changed
1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -225,9 +225,6 @@ module.exports = {
225
225
}
226
226
227
227
function handleFunctionComponent ( node ) {
228
- if ( ! checkTypes ) {
229
- return ;
230
- }
231
228
const firstArg = node . params [ 0 ] . typeAnnotation && node . params [ 0 ] . typeAnnotation . typeAnnotation ;
232
229
if ( firstArg && firstArg . type === 'TSTypeReference' ) {
233
230
const propType = typeAnnotations . get ( firstArg . typeName . name )
@@ -252,7 +249,7 @@ module.exports = {
252
249
}
253
250
}
254
251
255
- return {
252
+ return Object . assign ( {
256
253
CallExpression ( node ) {
257
254
if ( ! sortShapeProp || ! isShapeProp ( node ) || ! ( node . arguments && node . arguments [ 0 ] ) ) {
258
255
return ;
@@ -328,9 +325,9 @@ module.exports = {
328
325
typeAnnotations . set ( node . id . name , currentNode ) ;
329
326
}
330
327
} ,
331
-
328
+ } , checkTypes ? {
332
329
FunctionDeclaration : handleFunctionComponent ,
333
330
ArrowFunctionExpression : handleFunctionComponent ,
334
- } ;
331
+ } : null ) ;
335
332
} ,
336
333
} ;
You can’t perform that action at this time.
0 commit comments