# top-most EditorConfig file
# 最顶层配置文件(找到根文件就会停止查找,查找规则是在当前打开文件的目录和父目录中查找.editorconfig的文件。)
root = true
# 每个文件
[*]
# 缩进是以什么形式:space(空格)、tab(制表符)
indent_style = space
# 缩进大小(作用于space) 可以是整数或者tab
indent_size = 4
# 制表符宽度(作用于tab,通常不需要指定,默认值为indent_size)
# tab_width = 4
# 指定换行符为 Unix 样式的换行符(lf, cr, or crlf)
end_of_line = lf
# 设置默认的字符集编码
charset = utf-8
# 去掉每行末尾的空格
trim_trailing_whitespace = true
# 文件末尾插入新空行
insert_final_newline = true
# 使用大括号匹配多个文件
[*.{js,py}]
charset = utf-8
# 重写 lib 目录下所有 js 文件的缩进
[lib/**.js]
indent_style = space
indent_size = 2
# 匹配多个确切的文件
[{package.json,.travis.yml}]
indent_style = space
indent_size = 2
[Makefile]
indent_style = tab
; 注释评论的另一种方式
# 表示删除该属性的效果,使用编辑器默认设置
# indent_size = unset
EditorConfig配置 - 笔记
最新推荐文章于 2024-04-26 11:14:01 发布