解决:Trailing spaces not allowed 及 Newline required at end of file but not found 的问题(ESlint)

1、问题描述:

其一、报错信息为:

Trailing spaces not allowedNewline required at end of file but not found

中文为:
尾随空格不允许文件末尾需要换行但未找到

其二、报错的页面展示为:

在这里插入图片描述

2、问题分析:

使用的 ESLint 校验 Vue 项目时,产生的警告

3、问题解决:

1、将 .editorconfig 文件中的代码修改为:insert_final_newline = false

在这里插入图片描述

2、将 .eslintrc.js 文件中取消最后一个空行的规则校验为:‘eol-last’: 0

在这里插入图片描述

3、重新编译,就没有 ESLint 的校验问题了;

4、小结:

其一、哪里有不对或不合适的地方,还请大佬们多多指点和交流!
其二、有兴趣的话,可以多多关注这个专栏(Vue(Vue2+Vue3)面试必备专栏):https://blog.csdn.net/weixin_43405300/category_11525646.html?spm=1001.2014.3001.5482

猜你喜欢

转载自blog.csdn.net/weixin_43405300/article/details/130965769