File tree 1 file changed +3
-3
lines changed
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -63,7 +63,7 @@ module.exports = {
63
63
return rawStringValue . includes ( '\\' ) ;
64
64
}
65
65
66
- function escapeDoubleQuoteInString ( rawStringValue ) {
66
+ function escapeDoubleQuotes ( rawStringValue ) {
67
67
return rawStringValue . replace ( / \\ " / g, '"' ) . replace ( / " / g, '\\"' ) ;
68
68
}
69
69
@@ -85,7 +85,7 @@ module.exports = {
85
85
if ( parentType === 'JSXAttribute' ) {
86
86
textToReplace = expressionType === 'TemplateLiteral' ?
87
87
`"${ expression . quasis [ 0 ] . value . raw } "` :
88
- `"${ escapeDoubleQuoteInString (
88
+ `"${ escapeDoubleQuotes (
89
89
expression . raw . substring ( 1 , expression . raw . length - 1 )
90
90
) } "`;
91
91
} else {
@@ -104,7 +104,7 @@ module.exports = {
104
104
message : 'Need to wrap this literal in a JSX expression.' ,
105
105
fix : function ( fixer ) {
106
106
const expression = literalNode . parent . type === 'JSXAttribute' ?
107
- `{"${ escapeDoubleQuoteInString (
107
+ `{"${ escapeDoubleQuotes (
108
108
literalNode . raw . substring ( 1 , literalNode . raw . length - 1 )
109
109
) } "}` :
110
110
`{${ JSON . stringify ( literalNode . value ) } }` ;
You can’t perform that action at this time.
0 commit comments