1. .editorconfig文件配置官網:https://editorconfig.org/。
2. .editorconfig配置說明:
# 告訴EditorConfig插件,這是根文件,不用繼續往上查找
root = true
# 匹配全部文件
[*]
# 設置字符集
charset = utf-8
# 縮進風格,可選"space"、"tab"
indent_style = tab
# 縮進的空格數
indent_size = 4
# 結尾換行符,可選"lf"、"cr"、"crlf"
end_of_line = lf
# 在文件結尾插入新行
insert_final_newline = true
# 刪除一行中的前後空格
trim_trailing_whitespace = true
3. 在vscode中安裝editorConfig for vs Code插件。.editorconfig纔會起作用。