File tree Expand file tree Collapse file tree 1 file changed +13
-12
lines changed Expand file tree Collapse file tree 1 file changed +13
-12
lines changed Original file line number Diff line number Diff line change @@ -54,24 +54,25 @@ module.exports = function(context) {
5454 function checkForbidden ( declarations ) {
5555 declarations . forEach ( function ( declaration ) {
5656 var target ;
57+ var value = declaration . value ;
5758 if (
58- declaration . value . type === 'MemberExpression' &&
59- declaration . value . property &&
60- declaration . value . property . name &&
61- declaration . value . property . name === 'isRequired'
59+ value . type === 'MemberExpression' &&
60+ value . property &&
61+ value . property . name &&
62+ value . property . name === 'isRequired'
6263 ) {
63- declaration . value = declaration . value . object ;
64+ value = value . object ;
6465 }
6566 if (
66- declaration . value . type === 'CallExpression' &&
67- declaration . value . callee . type === 'MemberExpression'
67+ value . type === 'CallExpression' &&
68+ value . callee . type === 'MemberExpression'
6869 ) {
69- declaration . value = declaration . value . callee ;
70+ value = value . callee ;
7071 }
71- if ( declaration . value . property ) {
72- target = declaration . value . property . name ;
73- } else if ( declaration . value . type === 'Identifier' ) {
74- target = declaration . value . name ;
72+ if ( value . property ) {
73+ target = value . property . name ;
74+ } else if ( value . type === 'Identifier' ) {
75+ target = value . name ;
7576 }
7677 if ( isForbidden ( target ) ) {
7778 context . report ( declaration , 'Prop type `' + target + '` is forbidden' ) ;
You can’t perform that action at this time.
0 commit comments