-
Notifications
You must be signed in to change notification settings - Fork 29
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
Standardize Line Encodings #209
Comments
Prettier used to be in the repo, but was recently removed (#148). Having worked both with and without it in this repo, I find not having it to be less intrusive given its highly opinionated formatting, and support its removal; I feel eslint is sufficient. Eslint is able to autofix the line endings, which is convenient, though it is somewhat annoying to autofix only one rule should the need arise. I'd forgotten that this repo had already received a pass over fixing all reported eslint problems recently, so it should be just fine to also use autofix as the means to do one-time conversion in the working directory. My worry with leaving the eslint rule on now that this has been raised is its potential to annoy certain users with reported problems. If eslint wants one kind of line ending, and files are checked in fine with that line ending, but a user checks out locally with a different line ending due to platform/config, then eslint would spam warnings. If we are able to avoid this scenario even with the rule on using some combination of gitattributes/gitconfig, then that would be great. We would enjoy the benefit of avoiding mixed line endings being checked in. If I'm following correctly, we could unset the text attribute for the whole repo (ignore conversion) and rely on eslint to autofix to a certain line ending. And this would ignore all users' local gitconfigs for I think that would still rely on running eslint's autofix to guarantee standardisation. Would it be simpler to configure git to handle the conversion automatically? Perhaps some combination of I am not sure about how this setup would remove the need for some commit standardising all existing files in the index. As an aside, I tend to disable some of the time-consuming hooks when coding on Windows. For example, automatic reinstallation of packages, the full lint+fix+build pipeline before committing (admittedly less of a concern now given the drastically reduced build times, but I still tend to split my stuff into multiple smaller commits), and the running of scripts that don't work on Windows. Instead I run those manually, and use VSCode's eslint extension to fix/autofix problems myself as I code. |
Ah I see, I understand that prettier is pretty intrusive, so we can skip that then, I get your hesitation about time-consuming hooks as well. In that case, I think setting the Seems much simpler to configure git to handle it, I think something like this would be best:
Yeah, my bad, we'll still need to lump in a commit to standardize this, but this seems simple enough with the |
I assume that the proposed solution above is sufficient. I've added a PR to fix this issue #210 |
I may be looking into overall eslint improvements soon. I will try to factor this in and incorporate the PR's changes into that. |
Moved from #204
From @Cloud7050,
My perspective on this is informed by Prettier, which says:
Because of the above reason, I don't really agree with allowing for mixed line endings.
IMO, the best way to fix this issue will be to run prettier or eslint --fix in a pre-commit hook and configuring .gitattributes to ignore line endings project-wide, and then we don't even need to push a commit to convert all existing files.
Any thoughts?
The text was updated successfully, but these errors were encountered: