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

Add eslint to project and format files in project #244

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

herbertmaa
Copy link

No description provided.

@herbertmaa
Copy link
Author

#107

@herbertmaa herbertmaa closed this Mar 26, 2023
@herbertmaa herbertmaa reopened this Mar 26, 2023
},
rules: {
indent: ["error", 2],
"linebreak-style": ["error", "unix"],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you prefer removing the linebreak style check in lint or adding a gitattributes file ? Seems like most of the code base has CRLF

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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=lf

Or keep rules without linebreak-style but make sure they are converted to LF when added to the index

* text=auto

I 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.

@herbertmaa
Copy link
Author

@logicalup
Copy link
Collaborator

definitely agree on text=auto. Should we scrap this PR or someone wants to update it?

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.

3 participants