@@ -58,6 +58,10 @@ module.exports = {
58
58
}
59
59
60
60
function isPropTypesPackage ( node ) {
61
+ // Note: we really do want == with the package names here,
62
+ // since we need value equality, not identity - and
63
+ // these values are always string or null.
64
+ /* eslint-disable eqeqeq */
61
65
return (
62
66
node . type === 'Identifier' &&
63
67
node . name == propTypesPackageName
@@ -66,8 +70,11 @@ module.exports = {
66
70
node . property . name === 'PropTypes' &&
67
71
node . object . name == reactPackageName
68
72
) ;
73
+ /* eslint-enable eqeqeq */
69
74
}
70
75
76
+ /* eslint-disable no-use-before-define */
77
+
71
78
function checkValidCallExpression ( node ) {
72
79
const callee = node . callee ;
73
80
if ( callee . type === 'MemberExpression' && callee . property . name === 'shape' ) {
@@ -80,7 +87,6 @@ module.exports = {
80
87
}
81
88
}
82
89
83
- /* eslint-disable no-use-before-define */
84
90
function checkValidProp ( node ) {
85
91
if ( ( ! propTypesPackageName && ! reactPackageName ) || ! node ) {
86
92
return ;
@@ -107,6 +113,8 @@ module.exports = {
107
113
}
108
114
}
109
115
116
+ /* eslint-enable no-use-before-define */
117
+
110
118
function checkValidPropObject ( node ) {
111
119
if ( node && node . type === 'ObjectExpression' ) {
112
120
node . properties . forEach ( prop => checkValidProp ( prop . value ) ) ;
0 commit comments