Solving Error in modern -> ESLint: Expected linebreaks to be 'LF' but found 'CRLF'. (linebreak-style)

Rhamean2 years ago

Hi dear Anton,
I think the line shown as below should be added in .eslintrc.js file to get rid of errors:

..... 
rules: {
....
   'linebreak-style': ['error', process.env.NODE_ENV === 'prod' ? 'unix' : 'windows'],
  },
....

Best Regards

Anton Tananaev2 years ago

Not sure I understand. Are you getting an error trying to build it?

Rhamean2 years ago

There is nothing wrong with build or "npm start", but I see tens of the "Errors" that I mentioned, when I open any "*.js" files from modern.
I could fix it with adding the line I just commented above, into ".eslintrc.js"
I am working in windows 10, maybe it accurses for not working in linux or so.
I hope I didn't miss anything.

Anton Tananaev2 years ago

Where do you see the errors exactly?

Rhamean2 years ago

The errors come for each lines of any .js files in modern app.
I use IntellijIdea and it shows me the errors in problems tap.
for example I can see 43 errors from App.js while the app is running very well !
that is confusing for me but I am not sure what is going on.
Thanks and sorry

Anton Tananaev2 years ago

Sounds like you have an issues with your IntelliJ configuration.

Rhamean2 years ago

There must be, Sir.
Thank you so much for helping me.
Wishing you the best for every step in your endeavors and good luck...

Anton Tananaev2 years ago

I would recommend using VS Code for the modern app development. Much better experience.

The Rhamean solution works for me, I am using Windows and Visual Studio Code.

The Rhamean solution works for me as well! using win and vscode