code-formatting
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseCode Formatting
代码格式化
Format JS/TS/JSON files changed on the current branch using Biome.
使用Biome对当前分支中修改的JS/TS/JSON文件进行格式化。
Quick Usage
快速使用
bash
.claude/skills/code-formatting/scripts/format-branch.shThis formats all , , , , , files changed compared to .
.js.ts.jsx.tsx.json.jsoncmainbash
.claude/skills/code-formatting/scripts/format-branch.sh此命令会格式化所有相对于分支修改的、、、、、文件。
main.js.ts.jsx.tsx.json.jsoncCustom Base Branch
自定义基准分支
bash
.claude/skills/code-formatting/scripts/format-branch.sh developbash
.claude/skills/code-formatting/scripts/format-branch.sh developWhat It Does
功能说明
- Finds files changed on current branch vs base branch
- Filters to JS/TS/JSON files only
- Runs on those files
npx biome check --write - Uses same settings as the CI workflow
biome-check.yml
- 找出当前分支相对于基准分支修改的文件
- 仅筛选JS/TS/JSON类型的文件
- 对这些文件执行命令
npx biome check --write - 使用与CI工作流相同的配置
biome-check.yml
Config
配置
Biome config is at in repo root.
biome.jsoncBiome的配置文件位于仓库根目录的。
biome.jsoncNotes
注意事项
- Run from repo root
- Requires Node.js/npx
- Only formats changed files (not entire codebase)
- 需在仓库根目录运行
- 要求安装Node.js/npx
- 仅格式化修改过的文件(而非整个代码库)