Why might Prettier be removing CRs even if I think my line endings are consistent?

Responsive Ad Header

Question

Grade: Education Subject: Support
Why might Prettier be removing CRs even if I think my line endings are consistent?
Asked by:
82 Viewed 82 Answers

Answer (82)

Best Answer
(486)
Even if you believe your line endings are consistent, Prettier might still remove CRs due to various factors. Hidden or inconsistent line endings within files, especially those copied from different sources or edited in different editors, can cause problems. Also, some editors might automatically convert line endings, leading to discrepancies. Using a tool to normalize line endings (e.g., `dos2unix` on Linux/macOS, or using your editor's line ending conversion features) can help.