windows (linebreak-style) 预期换行符为“LF”,但发现“CRLF”。(eslint)
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/33189722/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
(linebreak-style) Expected linebreaks to be 'LF' but found 'CRLF'. (eslint)
提问by HappyCoder888
I had this error when running lint test, how solve this error:
运行 lint 测试时出现此错误,如何解决此错误:
(linebreak-style) Expected linebreaks to be 'LF' but found 'CRLF'. (eslint)
(linebreak-style) Expected linebreaks to be 'LF' but found 'CRLF'. (eslint)
PS: Maybe it will be helpfull: I'm using Windows (WebStorm), and the project is running and debugging in Debian.
PS:也许会有所帮助:我使用的是 Windows (WebStorm),并且该项目正在 Debian 中运行和调试。
回答by HappyCoder888
The main solution was that Windows by default using CRLF, like my WebStorm.
主要的解决方案是 Windows 默认使用 CRLF,就像我的 WebStorm。
1)first step is to change on WebStorm default encoding like there:
1)第一步是更改 WebStorm 默认编码,如下所示:
https://www.jetbrains.com/phpstorm/help/configuring-line-separators.html
https://www.jetbrains.com/phpstorm/help/configuring-line-separators.html
2)And change it on Status Bar
2)并在状态栏上更改它
https://www.jetbrains.com/phpstorm/help/status-bar.html
https://www.jetbrains.com/phpstorm/help/status-bar.html
Save it! and
保存!和
OKAY No lint warnings.
OKAY No lint warnings.
回答by Sahil Shikalgar
Run this in your terminal or cmd prompt
在您的终端或 cmd 提示符中运行它
git config core.autocrlf false
git rm --cached -r .
git reset --hard
Note - Make sure you don't have any un-committed changes else it will be deleted!
注意 - 确保您没有任何未提交的更改,否则它将被删除!