Open VismaTobbe opened 2 weeks ago
Can you provide more details on the "wrong encoding" case? What was the file encoded with before?
I'm also not able to reproduce the lf->crlf issue. If I have a file with crlf in it, that ending is preserved, likewise for lf.
@dummdidumm Some more details: I created the file in Rider, viewing it in VSCODE says UTF-8 with BOM
(and CRLF). After migration it becomes UTF-8
only (and CRLF).
I seem to forgot to mention the command line i used npx svelte-migrate svelte-5
if that helps.
Ok so then this is related to the BOM, and our writeFile logic not accounting for the format (it just assumes utf8 on read and write)
Describe the bug
When running svelte-migrate and there where no changes to file(s) they still are reported as changed by git. Running
git diff
reports lots ofLF will be replaced by CRLF the next time Git touches it
.I noticed on certain files, Rider reports wrong encoding.
Example
The file
Reported change
Reproduction
npx svelte-migrate svelte-5
git diff
Logs
No response
System Info
Severity
annoyance