[ESLint] error: Newline required at end of file but not found (eol-last)解决办法

原文链接:https://blog.csdn.net/yjd0504/article/details/121309202

使用ESLint校验Vue项目时,发现如下警告:

error: Newline required at end of file but not found (eol-last)

效果如下:

发现网上的解决办法,就是在警告的代码后面插入一个空行,觉得这样很不好。

无意间解决了,记录一下。

【解决】
1.把项目中有个配置文件.editorconfiginsert_final_newline=true改成false

 

 2. .eslintrc.js中取消最后该规则的校验'eol-last': 0

 

 重新编译,没有警告了。

 
posted @ 2022-11-15 16:05  每日一小步  阅读(331)  评论(0编辑  收藏  举报