vyt*_*ute 5 formatting line-endings eol visual-studio-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
Run Code Online (Sandbox Code Playgroud)
即使我在这些地方将行结尾设置更改为“/n”:
用户 -> 文本编辑器 -> 文件 -> Eol:
另外,工作区 -> 文本编辑器 -> 文件 -> Eol:
我的 ESLint 选项文件也有默认行结尾“\n”:
Prettier 也配置为默认的“\n”结束符:
这很奇怪,也许有人知道我还应该在哪里更改设置?谢谢。
找到解决方案:
在 VS Code 中,转到 Terminal -> New Terminal 并尝试查看 core.autocrlf 参数的值,如下所示:
git config --global --get core.autocrlf
Run Code Online (Sandbox Code Playgroud)
如果没有任何显示,则意味着它已设置为默认值(即 false),否则将其设置为 false:
git config --global core.autocrlf false
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3422 次 |
| 最近记录: |