ESLint : Expected linebreaks to be 'LF' but found 'CRLF' linebreak-style
WebStorm Ant Design Pro js報(bào)錯(cuò):ESLint : Expected linebreaks to be ‘LF’ but found ‘CRLF’ linebreak-style
解決:
檢查.eslinttrc.js是否有配置
/*eslint linebreak-style: ["error", "unix"]*/
Windows下 項(xiàng)目中的 .eslinttrc.js
... rules: {"linebreak-style": [0,"error", "windows"],... } ...參考 ESLint文檔 linebreak-style :
When developing with a lot of people all having different editors, VCS applications and operating systems it may occur that different line endings are written by either of the mentioned (might especially happen when using the windows and mac versions of SourceTree together).The linebreaks (new lines) used in windows operating system are usually carriage returns (CR) followed by a line feed (LF) making it a carriage return line feed (CRLF) whereas Linux and Unix use a simple line feed (LF). The corresponding control sequences are “\n” (for LF) and “\r\n” for (CRLF).
在使用不同的編輯器、VCS應(yīng)用程序和操作系統(tǒng)時(shí),使用的換行操作不一樣,造成了這種報(bào)錯(cuò)
總結(jié)
以上是生活随笔為你收集整理的ESLint : Expected linebreaks to be 'LF' but found 'CRLF' linebreak-style的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: Python超级玛丽马里奥源代码
- 下一篇: 两个手机进行蓝牙通信项目制作