react.dev
react.dev copied to clipboard
fix: implement `.editorconfig` to enforce LF line endings
Hello 😊
For general Windows users, when cloning the react.dev repository, LF often automatically changes to CRLF if no special settings are made in the editor. Typically, this changes back to LF during commits.
However,
- In some cases, due to bugs or conflicts, the conversion back to
LFdoes not occur properly. - To prevent
CRLFautomatic conversion on Windows, users must use commands likegit config --global core.autocrlf false, which is a drawback as it relies on personal settings of the user. - Due to the execution of pre-commit hooks,
CRLFis changed back toLFduring commits. However, since all file line endings are changed toCRLFafter cloning the repository on Windows, there is a major drawback where all files are marked as modified.
Example of an error situation:
On windows, After adding a comment // add test to the 404.js file and entering git commit -m "test", all files with CRLF are changed to LF, resulting in over 100 files showing changes.
Therefore, to ensure smooth compatibility between Windows and Linux/Mac users, I propose the adoption of .editorconfig, which is used in various repositories like 'react', 'eslint' and 'prettier'. By enforcing the use of LF, it is expected that Windows users will experience less confusion due to CRLF/LF issues during development.
Furthermore, I would like to tell you that after adopting .editorconfig, all the above-mentioned errors have been resolved. Thank you for your attention to this matter :)
The latest updates on your projects. Learn more about Vercel for Git ↗︎
| Name | Status | Preview | Comments | Updated (UTC) |
|---|---|---|---|---|
| 19-react-dev | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Jul 1, 2024 3:43am |
| react-dev | ✅ Ready (Inspect) | Visit Preview | Jul 1, 2024 3:43am |
Hi @lumirlumir!
Thank you for your pull request and welcome to our community.
Action Required
In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.
Process
In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.
Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.
If you have received this in error or have any questions, please contact us at [email protected]. Thanks!
Size changes
📦 Next.js Bundle Analysis for react-dev
This analysis was generated by the Next.js Bundle Analysis action. 🤖
This PR introduced no changes to the JavaScript bundle! 🙌
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!