education-demo的错误总结
- 感悟??
- 11.24
- Q1: Expected linebreaks to be 'LF' but found 'CRLF'
- Q2: Missing semicolon
- Q3: Newline required at end of file but not found.
- Q4:Already included file name 和 Missing file extension "vue" for
- Q5: The "****" component has been registered but not used
- Q6: this line has a lines of 103.maximum allowed is100.(max-len)
- 11.25
- 11.29
- 11.30
- 未解决的问题
感悟??
- 仅针对自己所发生的问题
- eslintrc规范性会把人搞死
- App.vue引入的标签要区分大小写,否则会不显示,又不报错
11.24
Q1: Expected linebreaks to be ‘LF’ but found ‘CRLF’
问题原因:eslint的规范检查所导致换行问题
解决方案:在.eslintrc.js文件里增加
rules: {
"linebreak-style": [0 ,"error", "windows"],//允许windows开发环境
},
Q2: Missing semicolon
问题原因:eslint规范检查的代码规范问题
解决方案:
//修改前
<script>
export default{}
</script>
// 修改后
<script>
export default{};
</script>
Q3: Newline required at end of file but not found.
问题原因:eslint的规范检查的代码规范问题
解决方案:在该页面最后一行加一个回车,及最后一行没有任何字符即可
Q4:Already included file name 和 Missing file extension “vue” for
问题描述:在App.vue里引入外部的的vue文件时,加上 .vue 后缀会报 Already included file name ,去掉 .vue 后缀又会报 Missing file extension “vue” for
问题原因:eslint的规范检查的代码规范问题
解决方案:在.eslintrc.js文件里增加
rules: {
'import/extensions': ['error', 'always', {
'js': 'never',
'vue': 'never'
}]
},
settings: {
'import/resolver': {
webpack: {
config: 'node_modules/@vue/cli-service/webpack.config.js',
},
},
},
Q5: The “****” component has been registered but not used
问题原因:eslint规范检查所导致的问题
解决方案:在.eslintrc.js文件里增加
rules: {
"vue/no-unused-components": "off",
},
Q6: this line has a lines of 103.maximum allowed is100.(max-len)
问题原因:eslint规范检查对一行的最大字符数所做的规范
解决方案:在.eslintrc.js文件里增加
rules: {
'max-len' : ["error", {code : 300}],
},
11.25
Q1: Unknown custom element router-view did you register the component correctly ? For recursive components, make sure to provide the “name” option. (未解决)
可能原因:我自定义的标签与html原生的标签产生了冲突
Q2:The template root requires exactly one element. (未解决)
11.29
Q1:Identifier is not a camel case (camelcase)
问题原因:eslint规范检查
解决方案:在.eslintrc.js文件里增加
rules: {
"camelcase": [1, {"properties": "never"}],
},
11.30
Q1:Invalid Host header
未解决
未解决的问题
Q1:Unexpected use of file extension “vue” for “./App.vue” import/extensions
虽然报错,但没有影响运行