#471·drawnix

Standardize text file line endings across Windows and Linux

Author: nightt5879Created Sep 8, 2026Updated Sep 8, 2026

Problem

Formatting checks can fail locally on Windows because Git checks out LF text files as CRLF, while the formatter expects LF. The same commit can pass the formatting check in Linux CI.

The repository currently has no .gitattributes file, and .editorconfig does not specify end_of_line. Checkout behavior therefore depends on contributors' Git settings, such as core.autocrlf=true.

Observed behavior

While validating #470 on Windows with core.autocrlf=true, the local formatting check reported 126 files. All 126 were stored as LF in Git and checked out as CRLF. The exact count depends on checkout history.

For example, git ls-files --eol showed:

i/lf    w/crlf    apps/web/vite.config.ts
i/lf    w/crlf    packages/react-board/vite.config.ts

Formatting isolated copies of these two files changed only their line endings. The formatting step in CI for the same commit passed on Ubuntu.

This creates inconsistent local and CI feedback and can lead contributors to make unnecessary repository-wide formatting changes. No whiteboard functionality was affected by the observed differences.

Reproduction

  1. On Windows, use a Git configuration with core.autocrlf=true.
  2. Check out the repository so Git writes the tracked text files into the working tree.
  3. Run npm ci and npm run format:check.
  4. Inspect affected files with git ls-files --eol and compare the local result with Linux CI.

Proposed approach

  • Define a repository-level LF policy for text files in .gitattributes, for example * text=auto eol=lf.
  • Add end_of_line = lf to .editorconfig so supported editors follow the same policy.
  • Add explicit exceptions if any platform-specific files require CRLF.
  • Document how existing contributors can align their working copies while preserving local changes.

Acceptance criteria

  • Normal Git checkouts on Windows and Linux follow the same text line-ending policy.
  • Formatting checks no longer differ solely because of LF/CRLF conversion.
  • Existing-checkout migration instructions are documented, and any normalization changes are limited to line endings.

Scope is limited to line-ending consistency. Required CI status checks and branch protection can be discussed separately.

AI assistance

Drafted with Codex/GPT-6 Astra. The observations were checked against Git line-ending metadata, isolated formatting comparisons, and the CI result linked above.