linebreak_vue-cli构建的项目,eslint一直报CRLF/LF的linebreak错误
如題,vue在構(gòu)建項目的時候選擇了airbnb規(guī)則,同時項目構(gòu)建后被windows的unix bash工具pull并且push過,這之后在windows上進行開發(fā),就開始一直報
Expected linebreaks to be 'CRLF' but found 'LF'
這樣的錯誤,后經(jīng)查是一種強制統(tǒng)一方式,并且解決方法是
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
}
結(jié)果無效,現(xiàn)有問題二個:
是否是因為系統(tǒng)環(huán)境不同而造成了某種強制轉(zhuǎn)換才會引發(fā)如上的錯誤?
如何選擇性的關(guān)閉eslint某個功能(linebreak檢查)?
總結(jié)
以上是生活随笔為你收集整理的linebreak_vue-cli构建的项目,eslint一直报CRLF/LF的linebreak错误的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: nc 端口转发
- 下一篇: vue项目启动时报error Expec