arunavabasucom / radis-app

A web app for high-resolution infrared molecular spectra using RADIS
https://radis.app
GNU Lesser General Public License v3.0
11 stars 16 forks source link

Bug Report: The Frontend files are showing Delete `␍` #685

Closed andreyscott closed 1 year ago

andreyscott commented 1 year ago

🐛 Describe the bug

[eslint] Delete CR [prettier/prettier] it's to my understanding of the codebase a line break error that occurs on the end of every line of the .tsx file the line breaks of the text file on windows and linux are different. Windows At the time of line break, carriage return is used at the same time CR(carriage-return character) and line breaks LF(linefeed character) Mac and Linux only use the newline character LF Old version of Mac uses carriage return CR Therefore, there will be incompatibility problems when text files are created and used in different systems.

cr error

💡 Possible solutions

A lot of solution comes to mind but I think the best will be and the one that works all the time will be to remove the below line of code from the .eslintrc.json "plugin:prettier/recommended", and the for good measure restart your code editor

fixed

Browser

Edge

anubhav2102 commented 1 year ago

Hello @andreyscott, for in case of typeScript files (frontend web page) I solved this issue by replacing all ' ' with " ", but for these files (above screenshots) we may need to remove prettier like you mentioned.

andreyscott commented 1 year ago

There's a lot of different ways to fix it but the one I proposed was the better I have seen so far

andreyscott commented 1 year ago

@erwanp should I make the required changes?

suzil commented 1 year ago

It would be nice to have the same file endings checked into source no matter whether it's from linux, windows, etc.

If the prettier config with eslint is applied, does it standardize the file endings the same way regardless of the operating system?

andreyscott commented 1 year ago

Yes. @suzil According to my research, the above solution is the best way to fix the issue for all OS another possible solution would be to create a .prettierrc file or a .prettierrc.json and add "endOfLine":"auto" to it

https://stackoverflow.com/questions/53516594/why-do-i-keep-getting-eslint-delete-cr-prettier-prettier I added a stackoverflow link if you would like to do further research