docsifyjs / docsify

🃏 A magical documentation site generator.
https://docsify.js.org
MIT License
27.78k stars 5.68k forks source link

chore: Create .gitattributes to prevent errors with Prettier in Windows #2288

Closed trusktr closed 1 year ago

trusktr commented 1 year ago

Summary

It is recommended by Prettier to use LF endings for all files including in Windows, and they officially recommend to set this option in .gitattributes file for consistency, and LF is the default in Prettier 2 or higher. The lack of this file bit me in another project whose build failed in Windows in GitHub Actions due to prettier --check failing in Windows with default LF mode.

More info: https://github.com/prettier/prettier/issues/7825#issuecomment-602171740

Related issue, if any:

What kind of change does this PR introduce?

Build-related changes Repo settings

For any code change,

Does this PR introduce a breaking change?

No

Tested in the following browsers:

N/A

vercel[bot] commented 1 year ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docsify-preview ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 22, 2023 1:12am
trusktr commented 1 year ago

Note, our build was not failing before this change, but without this change, some user's git configuration in Windows (apparently mine) could be different, and CRLF vs LF issues would pop up. Basically we've gotten lucky in our testing so far, and I don't normally dev in Windows so I happened to stumble on this when I tried.