Skip to content

EditorConfig

介绍

EditorConfig 是一个帮助开发者定义和维护一致的代码风格的工具。

快速开始

支持的配置文件
  • .editorconfig
bash
# EditorConfig is awesome: https://EditorConfig.org
root = true

[*]
charset = utf-8
indent_size = 2
indent_style = space
trim_trailing_whitespace = true
insert_final_newline = true

end_of_line = lf

[*.md]
trim_trailing_whitespace = false

[Makefile]
indent_style = tab

常见项目示例

Vue

ini
[*.{js,jsx,mjs,cjs,ts,tsx,mts,cts,vue}]
charset = utf-8
indent_size = 2
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

end_of_line = lf

基于 MIT 许可发布