error: Expected linebreaks to be 'LF' but found 'CRLF'

Posted yoyotl

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了error: Expected linebreaks to be 'LF' but found 'CRLF'相关的知识,希望对你有一定的参考价值。

error: Expected linebreaks to be ‘LF‘ but found ‘CRLF‘
1. 启用了eslint
2. 换行符不符合规则
解决方式:设置换行的判断规则
打开.eslintrc.js

rules: {
  no-console: process.env.NODE_ENV === production ? error : off,
  no-debugger: process.env.NODE_ENV === production ? error : off,
  linebreak-style: ["error", "windows"], //我这个版本是添加了这样一行,声明这是windows操作系统即可。
},

 

以上是关于error: Expected linebreaks to be 'LF' but found 'CRLF'的主要内容,如果未能解决你的问题,请参考以下文章