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) {
54
54
function checkForbidden ( declarations ) {
55
55
declarations . forEach ( function ( declaration ) {
56
56
var target ;
57
+ var value = declaration . value ;
57
58
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'
62
63
) {
63
- declaration . value = declaration . value . object ;
64
+ value = value . object ;
64
65
}
65
66
if (
66
- declaration . value . type === 'CallExpression' &&
67
- declaration . value . callee . type === 'MemberExpression'
67
+ value . type === 'CallExpression' &&
68
+ value . callee . type === 'MemberExpression'
68
69
) {
69
- declaration . value = declaration . value . callee ;
70
+ value = value . callee ;
70
71
}
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 ;
75
76
}
76
77
if ( isForbidden ( target ) ) {
77
78
context . report ( declaration , 'Prop type `' + target + '` is forbidden' ) ;
You can’t perform that action at this time.
0 commit comments