editorconfig
.editorconfig檔案
EditorConfig幫助開發人員在不同的編輯器和IDE之間定義和維護一緻的編碼樣式
adonisjs項目中的一個示例
root = true
[*]
indent_size = 2
indent_style = space
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
正常配置
# http://editorconfig.org
root = true
# 對所有檔案生效
[*]
# utf-8編碼
charset = utf-8
# 空格形式縮進2空格
indent_style = space
indent_size = 2
# Linux換行符
end_of_line = lf
# 使用單引号
quote_type = single
# 結尾插入新行
insert_final_newline = true
# 去除結尾空格
trim_trailing_whitespace = true
# 對字尾名為 md 的檔案生效
[*.md]
insert_final_newline = false
trim_trailing_whitespace = false
VSCode 插件:
EditorConfig for VS Code