diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000..43369450 --- /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 00000000..4493b286 --- /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 ef9c5c7b..cea0c845 100644 --- a/.prettierrc +++ b/.prettierrc @@ -4,5 +4,6 @@ "trailingComma": "all", "semi": false, "singleQuote": false, - "printWidth": 140 + "printWidth": 140, + "endOfLine": "lf" }