Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error Expected linebreaks to be 'LF' but found 'CRLF' linebreak-style #105

Closed
smartcris opened this issue Sep 24, 2017 · 11 comments
Closed

Comments

@smartcris
Copy link

I'm currently using windows, to fix this issue I tried adding an .eslintrc with /*eslint linebreak-style: ["error", "windows"]*/, but then I got this error :

D:\apps\react-cool-starter>yarn build:client
yarn build:client v1.0.2
$ yarn clean:client && better-npm-run build:client
running better-npm-run in D:\apps\react-cool-starter
Executing script: clean:client

to be executed: "rimraf ./build/public/assets"
running better-npm-run in D:\apps\react-cool-starter
Executing script: build:client

to be executed: "webpack --progress --hide-modules --config ./tools/webpack/webpack.client.babel.js"
Hash: 6385ef822779212c8ca4
Version: webpack 3.6.0
Time: 23660ms
4 assets

ERROR in ./src/client.js
Module build failed: Module failed because of a eslint error.

D:\apps\react-cool-starter\src\client.js
3:1 error Parsing error: The keyword 'import' is reserved

? 1 problem (1 error, 0 warnings)

error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

@martin2786
Copy link
Contributor

You need to add on package.json, under rules this line:

"linebreak-style": 0,

So it will look like:

"rules": {
"linebreak-style": 0,
"global-require": 0,
....

And remove the other stuff you've added.

@smartcris
Copy link
Author

thx that fixed my issue

@shahidkarimi
Copy link

@martin2786 there is nothing like "rules" in package.json

@martin2786
Copy link
Contributor

@shahidkarimi it is on eslintconfig section in package.json

@joseph-teb
Copy link

joseph-teb commented Apr 19, 2018

------------------for windows globe in package.son will read all import files---add--

"rules": {
"linebreak-style": 0,
"global-require": 0,
"eslint linebreak-style": [0, "error", "windows"],

@crescent-igor
Copy link

If you are using vscode i would recommend you to click the option at the bottom-right of the window and set it to LF from CRLF..this fixed my errors

@jocarsoft
Copy link

If you are using vscode i would recommend you to click the option at the bottom-right of the window and set it to LF from CRLF..this fixed my errors

example please!

@crescent-igor
Copy link

If you are using vscode i would recommend you to click the option at the bottom-right of the window and set it to LF from CRLF..this fixed my errors

example please!

screenshot from 2019-02-05 11-35-26
Go to the LF /CRLF to toggle it

@JaveedIshaq
Copy link

If you are using vscode i would recommend you to click the option at the bottom-right of the window and set it to LF from CRLF..this fixed my errors

Thanks

@gigamesh
Copy link

If you are using vscode i would recommend you to click the option at the bottom-right of the window and set it to LF from CRLF..this fixed my errors

This only works for the currently selected file, correct? I'm trying to get eslint to run properly in windows on a repo that is all LF. Not having any luck with these suggestions.

@MichalKoder
Copy link

If you are using vscode i would recommend you to click the option at the bottom-right of the window and set it to LF from CRLF..this fixed my errors

This only works for the currently selected file, correct? I'm trying to get eslint to run properly in windows on a repo that is all LF. Not having any luck with these suggestions.

I had similar problem with whole project and not just single files and fixed it with the following command:
npx eslint . --fix

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

No branches or pull requests

9 participants