Skip to content

Commit aa73543

Browse files
committed
Fix failing tests
1 parent c8e38c7 commit aa73543

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

src/index.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff 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,

0 commit comments

Comments
 (0)