File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -523,13 +523,13 @@ function sortStringLiteral(
523523 // If the original had escaping, apply the same escaping pattern to the result
524524 let newRawContent = result
525525
526- if ( originalRawContent !== originalValue && originalValue . includes ( '\\' ) ) {
527- // The original was escaped, so we need to escape the result in the same way
528- // But only escape backslashes that are followed by characters that form escape sequences
529- newRawContent = result . replace ( ESCAPE_SEQUENCE_PATTERN , '\\\\$1' )
530- }
531-
532526 if ( node . extra ) {
527+ if ( originalRawContent !== originalValue && originalValue . includes ( '\\' ) ) {
528+ // The original was escaped, so we need to escape the result in the same way
529+ // But only escape backslashes that are followed by characters that form escape sequences
530+ newRawContent = result . replace ( ESCAPE_SEQUENCE_PATTERN , '\\\\$1' )
531+ }
532+
533533 // JavaScript (StringLiteral)
534534 node . extra = {
535535 ...node . extra ,
You can’t perform that action at this time.
0 commit comments