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

1.在eslint的vue项目编译时出现:
[ESLint] error: Newline required at end of file but not found (eol-last)解决办法

原因是:文件代码的最后没有空行表示结束

image.png

(不推荐,因为如果你使用vscodecss-jss-formatter插件的话,代码保存时会把最后空行删掉)

解决方案

image.png

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

image.png

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

image.png

最后 编译通过


image.png

你可能感兴趣的:(Eslint--- error: Newline required at end of file but not found (eol-last))