File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change
1
+ // @ts -nocheck
1
2
/**
2
3
* @fileoverview Forbid using another component's propTypes
3
4
* @author Ian Christian Myers
@@ -109,7 +110,7 @@ module.exports = {
109
110
&& ! ast . isAssignmentLHS ( node )
110
111
&& ! isAllowedAssignment ( node )
111
112
) ) || (
112
- node . property . type === 'Literal'
113
+ ( node . property . type === 'Literal' || node . property . type === 'JSXText' )
113
114
&& node . property . value === 'propTypes'
114
115
&& ! ast . isAssignmentLHS ( node )
115
116
&& ! isAllowedAssignment ( node )
@@ -123,7 +124,7 @@ module.exports = {
123
124
124
125
ObjectPattern ( node ) {
125
126
const propTypesNode = node . properties . find (
126
- ( property ) => property . type === 'Property' && property . key . type === 'PrivateIdentifier ' && property . key . name === 'propTypes'
127
+ ( property ) => property . type === 'Property' && property . key . type === 'Identifier ' && property . key . name === 'propTypes'
127
128
) ;
128
129
129
130
if ( propTypesNode ) {
You can’t perform that action at this time.
0 commit comments