linebreak_vue-cli构建的项目,eslint一直报CRLF/LF的linebreak错误
如题,vue在构建项目的时候选择了airbnb规则,同时项目构建后被windows的unix bash工具pull并且push过,这之后在windows上进行开发,就开始一直报
Expected linebreaks to be 'CRLF' but found 'LF'
这样的错误,后经查是一种强制统一方式,并且解决方法是
linebreak-style: ["error", "windows"]
强制使用windows方式,我将之添加到了项目根目录下的 .eslintrc.js 文件中的rule字段下:
// add your custom rules here
'rules': {
// don't require .vue extension when importing
'import/extensions': ['error', 'always', {
'js': 'never',
'vue': 'never'
}],
// allow optionalDependencies
'import/no-extraneous-dependencies': ['error', {
'optionalDependencies': ['test/unit/index.js']
}],
// try to fix the line break problem
'linebreak-style': ["error", "windows"],
// allow debugger during development
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0
}
结果无效,现有问题二个:
是否是因为系统环境不同而造成了某种强制转换才会引发如上的错误?
如何选择性的关闭eslint某个功能(linebreak检查)?