nuxtrdev / nuxtr-vscode

An extension offering commands and tools to make your experience with Nuxt more pleasant.
https://marketplace.visualstudio.com/items?itemName=Nuxtr.nuxtr-vscode
336 stars 13 forks source link

[Bug]: VSCode is set to use LF line endings but nuxtr generates files with CRLF #107

Closed gnp closed 9 months ago

gnp commented 10 months ago

Environment

I'm on Mac OS X latest with up-to-date VSCode

What went wrong?

I created a new page for my app. The initial file contents came from some template. But the file had CRLF line endings. I use LF line endings. The first time this happened I did not catch it right away and now my git history has for that page a big commit where I checked in the fix to the line endings.

How to reproduce it?

Make a new page on a VScode set up to use LF line endings. Notice the file is created with CRLF line endings.

adhamfarrag commented 10 months ago

Hello @gnp, thanks for bringing this up. I tried to reproduce the issue and ended up with:

  1. "files.eol": "\n", VSCode configuration doesn't affect changing the format per file from VSCode status icon. When you say VSCode is set to LF. Do you mean global configuration ?

  2. If you're using a page/layout template. Nuxtr copies the whole file including the format which could be CRLF.

adhamfarrag commented 9 months ago

@gnp Closing it for now, please open it again if you're still facing this issue.

gnp commented 9 months ago

@adhamfarrag I think the problem is the templates are not all the same line ending so behavior is inconsistent.

Ideally there would be a way to control it to your liking. But barring that I'd say whatever line endings are used should be the same for all templates, not vary from template to template.