Skip to content
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

esLint goes crazy on Windows with CRLF rule #59

Closed
pilarArr opened this issue Sep 20, 2017 · 5 comments
Closed

esLint goes crazy on Windows with CRLF rule #59

pilarArr opened this issue Sep 20, 2017 · 5 comments
Assignees
Labels

Comments

@pilarArr
Copy link
Contributor

pilarArr commented Sep 20, 2017

It's the linebreak-style rule, they have a tip on that page as to how to fix it.

The matter is that git on Windows when it does the checkout it replaces all linebreaks from LF to CRLF, then again when you check the changes it does the inverse operation. git does this to ensure consistency on line breaks. At least that's what I understood that happens.

So if you don't use a linter, you don't notice this and it does affect you at all.
The problem is that this linter rule, checks for the linebreak and throws an error for all these line breaks and when you save the file in Atom it automatically does the fix and git registers that as a change in the file that you have to commit again. I did get to test what would happen if I actually went and committed the file (maybe it wont let me) but they suggest two ways around this:

  1. Changing the rule to allow both line breaks or disable it, but it doesn't feel right because then you could end up with mixed line breaks. But maybe we don't care about that.
  2. Or setting up a gitattributes file that would prevent git from doing that linebreak change on .js files.
@cleverbeagle
Copy link
Owner

What is the CRLF rule?

@pilarArr
Copy link
Contributor Author

@cleverbeagle updated the issue description

@cleverbeagle
Copy link
Owner

So in other words some people just like to watch the world burn? :p

Okay, then yes. I'd agree with what you're saying here and compromise with the gitattributes file. Going to queue this up as a chore. Happy to take it if you don't want to.

@cleverbeagle cleverbeagle self-assigned this Sep 20, 2017
@pilarArr
Copy link
Contributor Author

I already have it. I had to do it today for another project since we had a windows laptop joining the team and hell almost broke loose.

@cleverbeagle
Copy link
Owner

Hahaha right on 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants