Add eslint to project and format files in project#244
Add eslint to project and format files in project#244herbertmaa wants to merge 2 commits intotsitu:masterfrom
Conversation
| }, | ||
| rules: { | ||
| indent: ["error", 2], | ||
| "linebreak-style": ["error", "unix"], |
There was a problem hiding this comment.
If you are enforcing a linebreak style then a .gitattributes file is also needed for Window's users where git's setting for line-endings is going to default to CRLF on checkout.
There was a problem hiding this comment.
Would you prefer removing the linebreak style check in lint or adding a gitattributes file ? Seems like most of the code base has CRLF
There was a problem hiding this comment.
You need both. Git doesn't really have anything to do with linting but the opposite is not true. Linting will give errors if you checkout this repo on windows without a .gitattributes file and the eslint rc line-endings are set to LF.
But the files are actually LF. If you run git ls-files --eol then you will see that the index (the first column of output) shows all to be LF.
There was a problem hiding this comment.
My suggestion is to break as little as possible.
If we swap to unix linting then you must add a .gitattributes file for windows users so they checkout as LF. This would require users to reclone their repos.
That file would look like this:
* text=auto eol=lfOr keep rules without linebreak-style but make sure they are converted to LF when added to the index
* text=autoI think the least intrusive option is the 2nd as it doesn't require everyone to reclone. Unless there is a way to get the line-endings fixed without cloning.
|
definitely agree on text=auto. Should we scrap this PR or someone wants to update it? |
No description provided.