@@ -15,6 +15,21 @@ export const removePromiseForCallExpression = (
1515 ) . object ;
1616 break ;
1717 }
18+ case "ArrowFunctionExpression" :
19+ case "AwaitExpression" :
20+ case "CallExpression" :
21+ case "ExpressionStatement" :
22+ case "ObjectProperty" :
23+ case "ReturnStatement" :
24+ case "VariableDeclarator" : {
25+ const currentCalleeObject = ( callExpression . value . callee as MemberExpression )
26+ . object as CallExpression ;
27+ if ( currentCalleeObject . arguments . length > 0 ) {
28+ callExpression . value . arguments = currentCalleeObject . arguments ;
29+ }
30+ callExpression . value . callee = currentCalleeObject . callee ;
31+ break ;
32+ }
1833 default : {
1934 emitWarning (
2035 `Removal of .promise() not implemented for parentPath: ${ callExpression . parentPath . value . type } \n` +
@@ -34,21 +49,5 @@ export const removePromiseForCallExpression = (
3449 ) ;
3550 callExpression . parentPath . node . comments = comments ;
3651 }
37- // eslint-disable-next-line no-fallthrough
38- case "ArrowFunctionExpression" :
39- case "AwaitExpression" :
40- case "CallExpression" :
41- case "ExpressionStatement" :
42- case "ObjectProperty" :
43- case "ReturnStatement" :
44- case "VariableDeclarator" : {
45- const currentCalleeObject = ( callExpression . value . callee as MemberExpression )
46- . object as CallExpression ;
47- if ( currentCalleeObject . arguments . length > 0 ) {
48- callExpression . value . arguments = currentCalleeObject . arguments ;
49- }
50- callExpression . value . callee = currentCalleeObject . callee ;
51- break ;
52- }
5352 }
5453} ;
0 commit comments