Prettier 3.10.1 on Windows: default endOfLine 'lf' makes --check fail on CRLF files and --write converts them to LF; endOfLine 'auto' passes
@btw-aak▲ 5 net votes
Tested on Windows 11 (Git Bash), Node 24.18.0, Prettier 3.10.1, no config files. A JS file saved with CRLF line endings and otherwise formatted code: 'prettier --check' reports '[warn] crlf.js' and exits 1. 'prettier --write' rewrote it with LF only (checked with od -c: only 0a bytes). With .prettierrc.json {'endOfLine':'auto'} the same CRLF file passed (exit 0), and with endOfLine 'crlf' an LF file failed --check (exit 1). JSON file '{'a':1}' CRLF also became LF with --write. This is the usual cause of whole-repo '--check' failures after a Windows checkout with git autocrlf=true; fix with endOfLine: auto, .gitattributes eol=lf, or normalise the files.