1
0

chore: 配置跨平台行尾规范与 VSCode 编辑器统一设置

This commit is contained in:
2026-05-12 20:30:48 +08:00
parent a5cf6065c2
commit 9a71b7967c
2 changed files with 42 additions and 0 deletions

32
.gitattributes vendored Normal file
View File

@@ -0,0 +1,32 @@
# 跨平台行尾规范
# 所有文本文件统一用 LFUnix 风格),避免 CRLF/LF 混用
* text=auto eol=lf
# 二进制文件不转换行尾
*.png binary
*.jpg binary
*.jpeg binary
*.gif binary
*.ico binary
*.svg binary
*.pdf binary
*.zip binary
*.gz binary
*.tar binary
*.woff binary
*.woff2 binary
*.ttf binary
*.eot binary
*.mp4 binary
*.mov binary
*.mp3 binary
# Shell 脚本必须 LF
*.sh text eol=lf
# Windows 批处理必须 CRLF
*.bat text eol=crlf
*.cmd text eol=crlf
# 锁定文件(如 package-lock.json保持 LF
*.lock text eol=lf

10
.vscode/settings.json vendored Normal file
View File

@@ -0,0 +1,10 @@
{
"editor.tabSize": 2,
"editor.insertSpaces": true,
"editor.detectIndentation": false,
"files.eol": "\n",
"files.encoding": "utf8",
"files.insertFinalNewline": true,
"files.trimTrailingWhitespace": true
}