-
-
Notifications
You must be signed in to change notification settings - Fork 30
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
Bug: Lint error: Expected linebreaks to be 'LF' but found 'CRLF' #299
Comments
I'm unsure if we would want to add a lint rule for windows line breaks since the majority of people at OpenSauced are on macs and we wouldn't want to change those with an accidentally My assumption is also that we can't mix and match line endings: we sort of need to choose one. In the 'app' repo, we ignore line endings: I wonder if that's the solution here. |
Would the alternative solution (the eslint official docs that I included in the issue) work? I didn't see and missed a pass on a semicolon rule because all I could see was these line-breaking errors everywhere. 😂 The I'm not at my computer atm, but I can try applying the ignore line endings and let you know how it works later. 😊 |
@jpmcb I've tested out by adding the prettier to ignore the line endings as you pointed out. But it doesn't fix anything. So, I tried out adding a As mentioned on GitHub:
From what mentioned above, I think applying this won't affect line endings for Mac users. |
Feel free to drop a PR with some proposed changes and I can take a look on my mac 👍🏼 |
🎉 This issue has been resolved in version 1.14.3-beta.2 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
🎉 This issue has been resolved in version 1.15.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Describe the bug
When I worked on the
constants.ts
file, I get lots error messages:Expected linebreaks to be 'LF' but found 'CRLF'
.And this error happens in all TypeScript files.
Screenshot
Suggestion
After did some research, I found the same problem, and it happens only for Windows users.
As I am using Windows 11, the solution to add the
linebreak-style
rule configuration for Windows in this thread works. I don't get these error messages anymore. Below is the code I tried to apply in theeslintrc.js
:However, I'm not sure if this would be a good solution.
Alternative Solution
Adding a line in a
.gitattributes
file as mentioned in the official eslint docs to make it easy for developers to contribute to the codebase from different platforms.And here is another resources for adding a
.gitattributes
file.Steps to reproduce
On VS Code in the Windows machine:
error: Expected linebreaks to be 'LF' but found 'CRLF'
messages.Browsers
Chrome
Additional context (Is this in dev or production?)
No response
Code of Conduct
Contributing Docs
The text was updated successfully, but these errors were encountered: