File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -63,7 +63,7 @@ module.exports = {
6363 return rawStringValue . includes ( '\\' ) ;
6464 }
6565
66- function escapeDoubleQuoteInString ( rawStringValue ) {
66+ function escapeDoubleQuotes ( rawStringValue ) {
6767 return rawStringValue . replace ( / \\ " / g, '"' ) . replace ( / " / g, '\\"' ) ;
6868 }
6969
@@ -85,7 +85,7 @@ module.exports = {
8585 if ( parentType === 'JSXAttribute' ) {
8686 textToReplace = expressionType === 'TemplateLiteral' ?
8787 `"${ expression . quasis [ 0 ] . value . raw } "` :
88- `"${ escapeDoubleQuoteInString (
88+ `"${ escapeDoubleQuotes (
8989 expression . raw . substring ( 1 , expression . raw . length - 1 )
9090 ) } "`;
9191 } else {
@@ -104,7 +104,7 @@ module.exports = {
104104 message : 'Need to wrap this literal in a JSX expression.' ,
105105 fix : function ( fixer ) {
106106 const expression = literalNode . parent . type === 'JSXAttribute' ?
107- `{"${ escapeDoubleQuoteInString (
107+ `{"${ escapeDoubleQuotes (
108108 literalNode . raw . substring ( 1 , literalNode . raw . length - 1 )
109109 ) } "}` :
110110 `{${ JSON . stringify ( literalNode . value ) } }` ;
You can’t perform that action at this time.
0 commit comments