diff --git a/.editorconfig b/.editorconfig index 0f06ecf..6a4f588 100644 --- a/.editorconfig +++ b/.editorconfig @@ -3,7 +3,12 @@ root = true [*] charset = utf-8 indent_style = space -# indent_size = 2 +indent_size = 2 end_of_line = lf insert_final_newline = true trim_trailing_whitespace = true + +[*.ps1] +charset = utf-8-bom +end_of_line = crlf +indent_size = 4 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..0663416 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,5 @@ +# Default: auto-detect +* text=auto eol=lf + +# PowerShell scripts must use CRLF +*.ps1 text eol=crlf diff --git a/eslint.config.js b/eslint.config.js index ccdc122..5ba222e 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -27,6 +27,7 @@ export default [ "patches/", "wxcomponents/", "lib/", + "scripts/", ], languageOptions: { globals: { diff --git a/prettier.config.js b/prettier.config.js index 27575e1..ecfdfc1 100644 --- a/prettier.config.js +++ b/prettier.config.js @@ -24,5 +24,12 @@ export default { printWidth: 120, }, }, + { + files: ["*.ps1"], + options: { + endOfLine: "crlf", + tabWidth: 4, + }, + }, ], }; diff --git a/scripts/publish.ps1 b/scripts/publish.ps1 index ef77c1d..7a49cc8 100644 --- a/scripts/publish.ps1 +++ b/scripts/publish.ps1 @@ -1,4 +1,4 @@ -# 发布所有子包到私有 npm 仓库 +# 发布所有子包到私有 npm 仓库 # 使用方法: powershell scripts/publish.ps1 # 注意: 发布仓库地址使用各子包 package.json 中的 publishConfig.registry 配置 # 版本管理请先通过 pnpm release (standard-version) 完成,本脚本仅负责构建和发布 @@ -88,4 +88,4 @@ if ($push -eq "y" -or $push -eq "Y") { } Write-Host "" -Write-Host "🎉 所有包发布完成!版本: v$CURRENT_VERSION" -ForegroundColor Green \ No newline at end of file +Write-Host "🎉 所有包发布完成!版本: v$CURRENT_VERSION" -ForegroundColor Green