File tree Expand file tree Collapse file tree 3 files changed +4
-16
lines changed
Expand file tree Collapse file tree 3 files changed +4
-16
lines changed Original file line number Diff line number Diff line change @@ -81,7 +81,7 @@ module.exports = {
8181 ! isLeftSideOfAssignment ( node ) &&
8282 ! isAllowedAssignment ( node )
8383 ) || (
84- node . property . type === 'Literal' &&
84+ ( node . property . type === 'Literal' || node . property . type === 'JSXText' ) &&
8585 node . property . value === 'propTypes' &&
8686 ! isLeftSideOfAssignment ( node ) &&
8787 ! isAllowedAssignment ( node )
Original file line number Diff line number Diff line change @@ -171,7 +171,7 @@ module.exports = {
171171 const parentType = JSXExpressionNode . parent . type ;
172172
173173 if (
174- expressionType === 'Literal' &&
174+ ( expressionType === 'Literal' || expressionType === 'JSXText' ) &&
175175 typeof expression . value === 'string' &&
176176 ! needToEscapeCharacterForJSX ( expression . raw ) && (
177177 parentType === 'JSXElement' ||
@@ -246,13 +246,7 @@ module.exports = {
246246 }
247247 } ,
248248
249- Literal : node => {
250- if ( shouldCheckForMissingCurly ( node . parent , userConfig ) ) {
251- reportMissingCurly ( node ) ;
252- }
253- } ,
254-
255- JSXText : node => {
249+ 'Literal, JSXText' : node => {
256250 if ( shouldCheckForMissingCurly ( node . parent , userConfig ) ) {
257251 reportMissingCurly ( node ) ;
258252 }
Original file line number Diff line number Diff line change @@ -71,13 +71,7 @@ module.exports = {
7171 }
7272
7373 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 ) {
8175 if ( node . parent . type === 'JSXElement' ) {
8276 reportInvalidEntity ( node ) ;
8377 }
You can’t perform that action at this time.
0 commit comments