fix(formatter): incorrect handling of CRLF for multiline block comment (#16528)

close: #16405

In Windows, a multiline block comment contains a `\r\n` line break. However, the printer assumes all text has no `\r` at all; see #16531. In this PR, we use `LineTerminatorSplitter` to normalize all line breaks to `\n` to solve this problem.
This commit is contained in:
Dunqing committed 2025-12-06 15:29:23 +00:00
1 parent fd33a4da67
commit 75393e74ec
6 files changed
+147 -18

No files matched your search

+1
View File
@@ -1,3 +1,4 @@
crates/oxc_formatter/tests/fixtures/** text=auto eol=lf
crates/oxc_formatter/tests/fixtures/js/crlf text=auto eol=crlf
apps/oxfmt/test/fixtures/** text=auto eol=lf
apps/oxlint/test/fixtures/** text=auto eol=lf