mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #5598] pnpm check always fails on Windows checkouts: prettier flags every file over CRLF line endings #3100
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#3100
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @kolacheee on GitHub (Aug 28, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/5598
Originally assigned to: @kolacheee on GitHub.
What happens
On a normal Windows checkout,
pnpm check— the baseline validation command bothCONTRIBUTING.mdandCLAUDE.mdtell every contributor to run — always fails at theformat:checkstep. Prettier reports "code style issues" in every single.ts/.tsxfile (currently ~1,300 files), even on a completely clean tree with zero real changes. The failure has nothing to do with formatting: it's line endings.Why
Three defaults conflict:
.gitattributeshas* text=auto— files are stored LF in the repo, but Git converts them on checkout.core.autocrlf=trueby default — so the working tree gets CRLF..prettierrcdoesn't setendOfLine, and prettier's default is"lf"— soprettier --checkflags every CRLF line as a violation.CI never sees this because the only job that runs
pnpm check(pnpm-validateinpull-request-checks.yml) runs onubuntu-latest, where checkouts are LF. So the check is green in CI and red on every Windows contributor's machine, which trains Windows contributors to ignorepnpm checkfailures — the opposite of what a baseline gate is for.Try it yourself (on Windows,
core.autocrlf=true, clean clone)prints
i/lf w/crlf— LF in the repo, CRLF on disk. Then:fails, while the same file passes the moment line endings are taken out of the picture:
(
pnpm format:checkis just the first command overpackages/**/*.{ts,tsx}, hence ~1,300 warnings.)Two possible fixes
"endOfLine": "auto"to.prettierrc(one line, no side effects). Prettier then accepts the checkout's own line endings everywhere. The repo still stays LF because* text=autonormalizes on commit, and CI still checks real formatting on its LF checkout. This is the low-risk option.* text=auto eol=lfto.gitattributesso Windows working trees are LF too (the existing*.bat text eol=crlfexception already covers batch files). This is the more thorough option — it also fixes the handful of regression lanes that compare file contents against LF-assuming patterns and fail on CRLF checkouts for the same underlying reason — but every existing Windows clone needs a re-checkout (git checkout .after deleting/renormalizing, or a fresh clone) before it takes effect.Happy to PR either — the
.prettierrcone-liner if you want the safe fix now, or the.gitattributeschange if you'd rather solve the whole CRLF class at once.Verified on Windows 11, Git for Windows with
core.autocrlf=true, prettier 3.8.3 (the version pinned in the lockfile), currentstaging.@kolacheee commented on GitHub (Aug 29, 2026):
Going with the thorough option (kolacheee, agent-assisted):
.gitattributeseol=lfplus an explicitendOfLinepin in.prettierrc— it fixes the regression lanes that fail over CRLF for the same underlying reason, not just prettier. PR incoming with an end-to-end verification on a freshautocrlf=trueclone.