Skip to content

fix: line endings on Windows #136

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 31, 2019

Conversation

empyrical
Copy link
Member

Summary:

This pull request introduces a .gitattributes file into this repo to force git to use lf rather than crlf line endings on Windows. Without it, running yarn lint results in thousands of errors like this for Windows users:

   6:3   error  Expected linebreaks to be 'LF' but found 'CRLF'  linebreak-style
   6:3   error  Delete `␍`                                       prettier/prettier
   7:11  error  Expected linebreaks to be 'LF' but found 'CRLF'  linebreak-style
   7:11  error  Delete `␍`                                       prettier/prettier
   8:16  error  Expected linebreaks to be 'LF' but found 'CRLF'  linebreak-style
   8:16  error  Delete `␍`                                       prettier/prettier
   9:4   error  Expected linebreaks to be 'LF' but found 'CRLF'  linebreak-style
   9:4   error  Delete `␍`                                       prettier/prettier

This fix is the one suggested by the ESLint documentation:

https://eslint.org/docs/rules/linebreak-style#using-this-rule-with-version-control-systems

Test Plan:

Running yarn lint works properly on Windows with this fix in place.

@thymikee
Copy link
Member

Thanks!

@thymikee thymikee merged commit 62b11ff into react-native-community:master Jan 31, 2019
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.

2 participants