我的项目包含包含以下内容的.editorconfig文件:
[*.{js}]
charset = utf-8
indent_style = space
indent_size = 4我认为这将迫使我的VS代码使用4个空格的缩进样式空格。
我从扩展列表中安装了EditorConfig for vs code扩展。
但是仍然没有,我新创建的文件没有自动设置配置的空间样式。问题出在哪里?
发布于 2019-02-15 01:56:35
我想我找到解决方案了。当我在VSCode的文件夹结构边栏上右击并选择Generate .editorconfig (这样就让插件来创建它)来创建.editorconfig时,它就可以工作了。
单击文件下方的空白区域:

发布于 2018-01-09 22:40:11
尝试
root = true
[*.js]
indent_style = space
indent_size = 4
charset = utf-8发布于 2018-09-06 17:41:28
你也可以试试这个,如果你喜欢,你可以换成空格:)
root = true
[*]
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = tab
indent_size = 2
[*.{js,txt,md,css,html,php,py,json,yml,sass,pug}]
indent_style = tab
indent_size = 2
[*.{diff,md}]
trim_trailing_whitespace = falsehttps://stackoverflow.com/questions/47357322
复制相似问题