diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000..3675b057 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,33 @@ +# EditorConfig is awesome: https://EditorConfig.org + +# 顶级配置文件 +root = true + +# 所有文件的默认设置 +[*] +charset = utf-8 +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true + +# TypeScript/JavaScript 文件 +[*.{ts,tsx,js,jsx}] +indent_style = space +indent_size = 2 + +# JSON 文件 +[*.json] +indent_style = space +indent_size = 2 + +# Markdown 文件(不删除行尾空格,因为两个空格代表换行) +[*.md] +trim_trailing_whitespace = false + +# YAML 文件 +[*.{yml,yaml}] +indent_style = space +indent_size = 2 + + + diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..d2feb300 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,37 @@ +# 设置默认行为,防止自动转换导致问题 +* text=auto + +# TypeScript/JavaScript 文件 +*.ts text eol=lf +*.tsx text eol=lf +*.js text eol=lf +*.jsx text eol=lf +*.json text eol=lf + +# 配置文件 +*.yaml text eol=lf +*.yml text eol=lf +.editorconfig text eol=lf +.gitattributes text eol=lf +.gitignore text eol=lf + +# Markdown 文档 +*.md text eol=lf + +# Shell 脚本 +*.sh text eol=lf + +# Windows 脚本 +*.bat text eol=crlf +*.ps1 text eol=crlf + +# 二进制文件 +*.png binary +*.jpg binary +*.jpeg binary +*.gif binary +*.ico binary +*.pdf binary + + +