Skip to content
This repository has been archived by the owner on Jun 24, 2020. It is now read-only.

"error Expected linebreaks to be 'LF' but found 'CRLF' linebreak-style" when running on Windows #25

Open
kwahsog opened this issue Mar 27, 2018 · 0 comments

Comments

@kwahsog
Copy link

kwahsog commented Mar 27, 2018

The testing examples describes running:

git clone https://github.com/learn-anything/react-mindmap
cd react-mindmap
npm install && npm run test

This fails on Windows (tested on Win10) with the same error in various JS files when using 'npm run test':

C:...\react-mindmap\src\utils\subnodesToHTML.js
1:50 error Expected linebreaks to be 'LF' but found 'CRLF' linebreak-style
2:1 error Expected linebreaks to be 'LF' but found 'CRLF' linebreak-style
3:3 error Expected linebreaks to be 'LF' but found 'CRLF' linebreak-style

Solutions discussed in Stackoverflow:

https://stackoverflow.com/questions/39114446/how-can-i-write-a-eslint-rule-for-linebreak-style-changing-depending-on-windo/

Personally, I resolved by changing .eslintrc.js to:

rules: {
'react/jsx-uses-vars': 'error',
'react/jsx-uses-react': 'error',
"linebreak-style": 0
},

This just ignores line endings which I assume would be appriopriate for all OSs?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant