行结尾不遵循 VS Code 中的默认设置

问题描述

当我尝试推送到 GitHub 时,每次我都会收到这样的警告:

warning: LF will be replaced by CRLF in app/bingey-api/models/user.js.
The file will have its original line endings in your working directory

即使我在这些地方将行尾设置更改为“/n”:

用户 -> 文本编辑器 -> 文件 -> Eol:

enter image description here

还有工作区 -> 文本编辑器 -> 文件 -> Eol:

enter image description here

我的 ESLint 选项文件也有认的行尾“\n”:

enter image description here

并且 Prettier 也被配置为认的“\n”结束符:

enter image description here

这很奇怪,也许有人知道我还应该在哪里更改设置? 谢谢。

找到的解决方案:

在 VS Code 中,转到 Terminal -> New Terminal 并尝试查看您的 core.autocrlf 参数的值,如下所示:

 git config --global --get core.autocrlf  

如果没有显示,则表示它被设置为认值(这是错误的) 否则,将其设置为 false:

 git config --global core.autocrlf false

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)