vue项目因为eslint报错的原因及解决办法
一、报错:errorExpected indentation of 2 spaces but found 3indent原因:像这种就是多或者少空格导致的,想上面一个就是多了一个空格。解决:将多余(缺少)的空格删除(补全)即可注意事项:如果使用过代码格式化工具,可能会很难调整对象中的参数,可以先将其禁用。二、报错:Newline required at end of file but not fo
·
一、报错:error Expected indentation of 2 spaces but found 3 indent
原因:像这种就是多或者少空格导致的,想上面一个就是多了一个空格。
解决:将多余(缺少)的空格删除(补全)即可
注意事项:如果使用过代码格式化工具,可能会很难调整对象中的参数,可以先将其禁用。
二、报错:Newline required at end of file but not found eol-last
原因:eslint需要文件最后有一个空号,而你没有
解决:在对应文件末尾添加一个空行
三、报错:error Missing space before value for key ‘name’ key-spacing
原因:eslint的格式中键值对之间要有一个空格,如:
name: "张三"
四、报错error Strings must use singlequote quotes
原因:eslint的格式中字符串要使用单引号
五、报错:imported multiple times import/no-duplicates
原因:import导入过多,按需导入时,from是同一个文件,请写在同一个import中
更多推荐
已为社区贡献4条内容
所有评论(0)