Closed himaanshu24 closed 1 year ago
We have had contributors with different operating systems and we used Rome formatter for a while, and we haven't had issues concerning the EOL on different OSs.
Is there any chance you'll be able to create a repo where it's possible to reproduce the issue?
We have had contributors with different operating systems and we used Rome formatter for a while, and we haven't had issues concerning the EOL on different OSs.
Is there any chance you'll be able to create a repo where it's possible to reproduce the issue?
Hi @ematipico,
I have created the following repo on my mac machine
ran npm install
ran the npm run fix:js
then ran the npm run format:js
// no error shown
then cloned it on my windows machine and did npm install
and
ran the npm run format:js
// throw error
vscode-bash
git-bash
cmd
I believe this is the expected behaviour and it's not an issue related to Rome.
Have you tried fix the issue using git? https://github.com/rome/tools/blob/main/.gitattributes#L1
Actually, I do have .gitattributes
file at the root of my project. It has the following entry
# Autodetect text files
* text=auto
# Force all text file types to have unix line endings
*.* text eol=lf
Let me try to add the same exact line provided by you in the given test repo above.
Hi @ematipico, I tried the exact entry in .gitattributes
, but the issue still persists.
Can you please check the given repo - https://github.com/himaanshu24/rome-test
I think this file only affects the git actions which is working fine. I don't know if the rome format
is also using the same file for file-attributes or does it has some default config for EOL.
Thanks
@ematipico, This issue is resolved when using the .gitattributes
file. But I have to reset using the following command since this is an existing/old project.
git rm --cached -r .
git reset --hard
Thanks for your help.
Environment information
What happened?
npx rome format . --write
on mac, fixing the format.npx rome format .
to check if there is any error. Run successfully and does not through any errors.npx rome format .
- errors are reported with eol (cr)Expected result
The eol should be consistent on running
npx format .
and does not change from mac-windows-mac. This creates an issue every time the code is pushed/pulled to/from mac and windows creating chaos and wasting a lot of time.Code of Conduct