File tree 3 files changed +4
-16
lines changed 3 files changed +4
-16
lines changed Original file line number Diff line number Diff line change @@ -81,7 +81,7 @@ module.exports = {
81
81
! isLeftSideOfAssignment ( node ) &&
82
82
! isAllowedAssignment ( node )
83
83
) || (
84
- node . property . type === 'Literal' &&
84
+ ( node . property . type === 'Literal' || node . property . type === 'JSXText' ) &&
85
85
node . property . value === 'propTypes' &&
86
86
! isLeftSideOfAssignment ( node ) &&
87
87
! isAllowedAssignment ( node )
Original file line number Diff line number Diff line change @@ -171,7 +171,7 @@ module.exports = {
171
171
const parentType = JSXExpressionNode . parent . type ;
172
172
173
173
if (
174
- expressionType === 'Literal' &&
174
+ ( expressionType === 'Literal' || expressionType === 'JSXText' ) &&
175
175
typeof expression . value === 'string' &&
176
176
! needToEscapeCharacterForJSX ( expression . raw ) && (
177
177
parentType === 'JSXElement' ||
@@ -246,13 +246,7 @@ module.exports = {
246
246
}
247
247
} ,
248
248
249
- Literal : node => {
250
- if ( shouldCheckForMissingCurly ( node . parent , userConfig ) ) {
251
- reportMissingCurly ( node ) ;
252
- }
253
- } ,
254
-
255
- JSXText : node => {
249
+ 'Literal, JSXText' : node => {
256
250
if ( shouldCheckForMissingCurly ( node . parent , userConfig ) ) {
257
251
reportMissingCurly ( node ) ;
258
252
}
Original file line number Diff line number Diff line change @@ -71,13 +71,7 @@ module.exports = {
71
71
}
72
72
73
73
return {
74
- Literal : function ( node ) {
75
- if ( node . parent . type === 'JSXElement' ) {
76
- reportInvalidEntity ( node ) ;
77
- }
78
- } ,
79
-
80
- JSXText : function ( node ) {
74
+ 'Literal, JSXText' : function ( node ) {
81
75
if ( node . parent . type === 'JSXElement' ) {
82
76
reportInvalidEntity ( node ) ;
83
77
}
You can’t perform that action at this time.
0 commit comments