File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ module.exports = {
54
54
let countNewLinesBeforeContent = 0 ;
55
55
let countNewLinesAfterContent = 0 ;
56
56
57
- if ( child . type === 'Literal' ) {
57
+ if ( child . type === 'Literal' || child . type === 'JSXText' ) {
58
58
if ( / ^ \s * $ / . test ( child . raw ) ) {
59
59
return ;
60
60
}
@@ -110,14 +110,14 @@ module.exports = {
110
110
}
111
111
112
112
function spaceBetweenPrev ( ) {
113
- return ( prevChild . type === 'Literal' && / $ / . test ( prevChild . raw ) ) ||
114
- ( child . type === 'Literal' && / ^ / . test ( child . raw ) ) ||
113
+ return ( ( prevChild . type === 'Literal' || prevChild . type === 'JSXText' ) && / $ / . test ( prevChild . raw ) ) ||
114
+ ( ( child . type === 'Literal' || child . type === 'JSXText' ) && / ^ / . test ( child . raw ) ) ||
115
115
sourceCode . isSpaceBetweenTokens ( prevChild , child ) ;
116
116
}
117
117
118
118
function spaceBetweenNext ( ) {
119
- return ( nextChild . type === 'Literal' && / ^ / . test ( nextChild . raw ) ) ||
120
- ( child . type === 'Literal' && / $ / . test ( child . raw ) ) ||
119
+ return ( ( nextChild . type === 'Literal' || nextChild . type === 'JSXText' ) && / ^ / . test ( nextChild . raw ) ) ||
120
+ ( ( child . type === 'Literal' || child . type === 'JSXText' ) && / $ / . test ( child . raw ) ) ||
121
121
sourceCode . isSpaceBetweenTokens ( child , nextChild ) ;
122
122
}
123
123
You can’t perform that action at this time.
0 commit comments