我在使用 Typescript 的 Vue 项目中遇到了 prettier + eslint 的问题。一切都按预期工作,除了一件事,在文件末尾插入新行。
Insert `␍⏎`eslintprettier/prettier
Newline required at end of file but not found.eslinteol-last
我正在使用 VSCode。这些是我的设置:
我将 vetur 作为 vue 文件的默认格式化程序:
"[vue]": {
"editor.defaultFormatter": "octref.vetur"
}
在 vetur 中,我有这样的格式化程序:
但是当我保存 `.vue 文件时,所有内容都已格式化但文件末尾没有新行。为什么不?我可以在 VSCode 中启用此设置:
不过我觉得应该没必要,更漂亮的应该这样做。
我错过了什么吗?