解决方法:
1、创建新的. editorconfig并将其放在项目根目录下,
我的配置如下;
请安装#vscode插件:安装CTRL SHIFT X搜索编辑器配置
# http://编辑器config.org
根=真
[*]
charset=utf-8
indent_style=space
indent_size=2
end_of_line=lf
insert_final_newline=true
trim_trailing_whitespace=true
[*.md]
insert_final_newline=false
trim_trailing_whitespace=false
有关具体的配置步骤,请参阅:
https://编辑config.org /
2、请安装vscode插件编辑器配置
打开并安装CTRL SHIFT X搜索编辑器配置
这样,你只要创建新文件或者Ctrl S旧文件就可以了~