@@ -10,6 +10,7 @@ const values = require('object.values');
10
10
11
11
const Components = require ( '../util/Components' ) ;
12
12
const propsUtil = require ( '../util/props' ) ;
13
+ const astUtil = require ( '../util/ast' ) ;
13
14
const docsUrl = require ( '../util/docsUrl' ) ;
14
15
const propWrapperUtil = require ( '../util/propWrapper' ) ;
15
16
const report = require ( '../util/report' ) ;
@@ -26,7 +27,7 @@ const getText = eslintUtil.getText;
26
27
function nestedPropTypes ( prop ) {
27
28
return (
28
29
prop . type === 'Property'
29
- && prop . value . type === 'CallExpression'
30
+ && astUtil . isCallExpression ( prop . value )
30
31
) ;
31
32
}
32
33
@@ -311,7 +312,7 @@ module.exports = {
311
312
}
312
313
if (
313
314
node . value
314
- && node . value . type === 'CallExpression'
315
+ && astUtil . isCallExpression ( node . value )
315
316
&& propWrapperUtil . isPropWrapperFunction (
316
317
context ,
317
318
getText ( context , node . value . callee )
@@ -337,7 +338,7 @@ module.exports = {
337
338
}
338
339
const right = node . parent . right ;
339
340
if (
340
- right . type === 'CallExpression'
341
+ astUtil . isCallExpression ( right )
341
342
&& propWrapperUtil . isPropWrapperFunction (
342
343
context ,
343
344
getText ( context , right . callee )
0 commit comments