twilio-labs / twilio-style

Twilio's shareable ESLint config

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Expected linebreaks to be 'LF' but found 'CRLF' linebreak-style

dlemstra opened this issue · comments

When I tried to use this configuration in the create-twilio-function project I got spammed with the following error:

Expected linebreaks to be 'LF' but found 'CRLF' linebreak-style

This is happening because I am working on a Windows machine. This can be resolved by either removing this line:

'linebreak-style': ['error', 'unix'],

or by adding a .gitattributes file to all the projects that use this config.

@dlemstra You can add an override in your repo to turn that rule off in your .eslintrc.

{
  "extends": [
    "twilio"
  ],
  "rules": {
    "linebreak-style": "off"
  }
}

Could you clarify why I should turn that rule off in a repository @ahcai? This would mean that this would needs to be turned off in any repository that also builds on Windows and has no .gitattributes file forcing LF. Are there plans to add .gitattributes files to all the repositories? And then turn that rule back on?

We can only set the linebreak to be either LF (for Unix) or CRLF (for Windows) but not both at the same time, so whichever rule we choose to, is going to cause issues for some developers.

We chose Unix because that's recommended ESLint rule as well as the AirBnB rule.

Should we not add a .gitattributes file to the repository to force LF in the repositories that use this library?

@dlemstra We'll do that!

@dlemstra This is fixed in v1.15.2.