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

Airbnb Eslint preset complains about line break format on Windows after pulling a project from a git repository #1654

Closed
wujekbogdan opened this issue Jun 22, 2018 · 3 comments

Comments

@wujekbogdan
Copy link

Version

3.0.0-rc.3

Reproduction link

airbnb/javascript#1224

Steps to reproduce

  1. Set up a project using the Airbnb Eslint preset.
  2. Do not make any changes, just commit the code to a git repo on a *nix machine.
  3. Pull the repo on a Windows machine.
  4. Run yarn serve or yarn build.

What is expected?

The project is built, Eslint is not complaining.

What is actually happening?

Eslint throws tons of erros like:

error: Expected linebreaks to be 'LF' but found 'CRLF`

It happens because on Windows, by default, GIT converts LF to CRLF when pulling and converts it back to LF when pushing.
I know that this is an Airbnb preset issue, not a vue-cli issue, but before it's fixed on the Aribnb side a temporary fix should be applied in the vue-cli eslint config - the linebreak-style should be disabled.

@yyx990803
Copy link
Member

Just tweak the settings yourself via eslintrc. Vue CLI only exports the exact airbnb config, and we will not be making modifications.

@wujekbogdan
Copy link
Author

@yyx990803
I have already applied a fix in my Eslint config, but this issue affects all Windows users that share their code via Git with non-Windows users. It's not an edge case. IMO it would be good to apply a workaround in vue-cli and remove it once the issue is fixed on the Airbnb side.

@yyx990803
Copy link
Member

Please submit a PR if you think it's important.

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

No branches or pull requests

2 participants