Skip to content

fix: normalize line endings via .gitattributes - #68

Merged
ivoIturrieta merged 1 commit into
unlayer:mainfrom
ApexYash11:fix/normalize-line-endings
Sep 7, 2026
Merged

fix: normalize line endings via .gitattributes#68
ivoIturrieta merged 1 commit into
unlayer:mainfrom
ApexYash11:fix/normalize-line-endings

Conversation

@ApexYash11

Copy link
Copy Markdown
Contributor

Closes #67

What & why

There was no .gitattributes and prettier.config.js doesn't override endOfLine. On Windows with the common core.autocrlf=true checkout, every file is checked out with \r\n line endings, so:

  • npm run lint (prettier --check .) flags all 26 files as having style issues (Prettier defaults to endOfLine: 'lf').
  • npm run format would rewrite the whole tree, creating huge diffs and blocking Windows contributors.

Change

Add a .gitattributes that normalizes text files to LF:

* text=auto eol=lf
*.bat text eol=crlf   # Windows batch scripts need CRLF

This makes npm run lint / npm run format behave identically on Windows and Linux/CI. It is a zero-runtime-risk change.

Verification

  • Reproduced locally: before the fix, prettier --check . reported issues in 26/26 files (all CRLF).
  • After the fix, a fresh clone + checkout produces LF line endings and prettier --check src reports All matched files use Prettier code style!.
  • npm run typecheck and npm test are unaffected (no runtime code changed).

@vercel

vercel Bot commented Sep 4, 2026

Copy link
Copy Markdown

@ApexYash11 is attempting to deploy a commit to the Unlayer Team on Vercel.

A member of the Team first needs to authorize it.

@ivoIturrieta
ivoIturrieta merged commit e4624bd into unlayer:main Sep 7, 2026
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG-002: Missing .gitattributes breaks lint/format for Windows contributors

2 participants