From c2bc13b5d65bbce4c6cfa7f0874b7d266c26d9b1 Mon Sep 17 00:00:00 2001 From: zjf <1799650030@qq.com> Date: Sat, 11 Oct 2025 12:57:35 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=B7=BB=E5=8A=A0=20.gitattributes=20?= =?UTF-8?q?=E5=92=8C=20.editorconfig=20=E7=BB=9F=E4=B8=80=E6=8D=A2?= =?UTF-8?q?=E8=A1=8C=E7=AC=A6=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .editorconfig | 26 ++++++++++++++++++++++++++ .gitattributes | 33 +++++++++++++++++++++++++++++++++ .prettierrc | 3 ++- 3 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 .editorconfig create mode 100644 .gitattributes diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..4336945 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,26 @@ +# EditorConfig is awesome: https://EditorConfig.org + +# 表示是最顶层的配置文件 +root = true + +# 对所有文件生效 +[*] +charset = utf-8 +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true + +# 对 JS、TS、Vue 文件的配置 +[*.{js,jsx,ts,tsx,vue}] +indent_style = tab +indent_size = 2 + +# 对 JSON、YAML 文件的配置 +[*.{json,yml,yaml}] +indent_style = tab +indent_size = 2 + +# 对 Markdown 文件的配置 +[*.md] +trim_trailing_whitespace = false + diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..4493b28 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,33 @@ +# 设置默认行为,以防人们没有设置 core.autocrlf +* text=auto + +# 明确声明你想要始终规范化并在检出时转换为原生行结束符的文本文件 +*.vue text eol=lf +*.js text eol=lf +*.ts text eol=lf +*.jsx text eol=lf +*.tsx text eol=lf +*.json text eol=lf +*.css text eol=lf +*.scss text eol=lf +*.sass text eol=lf +*.html text eol=lf +*.htm text eol=lf +*.xml text eol=lf +*.md text eol=lf +*.yml text eol=lf +*.yaml text eol=lf + +# 明确声明你不想规范化并希望原样保留的文件 +*.png binary +*.jpg binary +*.jpeg binary +*.gif binary +*.ico binary +*.svg binary +*.eot binary +*.ttf binary +*.woff binary +*.woff2 binary +*.otf binary + diff --git a/.prettierrc b/.prettierrc index ef9c5c7..cea0c84 100644 --- a/.prettierrc +++ b/.prettierrc @@ -4,5 +4,6 @@ "trailingComma": "all", "semi": false, "singleQuote": false, - "printWidth": 140 + "printWidth": 140, + "endOfLine": "lf" }