🎨 style(markdown): format markdown files
This commit is contained in:
@@ -23,6 +23,7 @@ description:
|
||||
## Procedure(default)
|
||||
|
||||
1. **Baseline**
|
||||
|
||||
- 记录当前状态:`git status --porcelain`
|
||||
- 明确范围(默认只处理变更文件):
|
||||
- staged:`git diff --name-only --cached`
|
||||
@@ -30,6 +31,7 @@ description:
|
||||
- untracked:`git ls-files -o --exclude-standard`
|
||||
|
||||
2. **Detect Toolchain(prefer repo truth)**
|
||||
|
||||
- 优先用仓库既有入口脚本 / 配置:
|
||||
- JS/TS:`package.json`
|
||||
scripts(`format`/`lint`/`lint:fix`)、prettier/biome/eslint 配置
|
||||
@@ -41,6 +43,7 @@ description:
|
||||
- 禁止默认“引入新 formatter/linter 配置”;缺配置时只做最小手工调整,并先确认是否允许落地配置文件。
|
||||
|
||||
3. **Apply(format first, then lint)**
|
||||
|
||||
- 先 formatter(会改文件),再 lint(检查),再 lint
|
||||
--fix(如有),最后再跑一次 check 确认干净。
|
||||
- 默认只处理目标文件集合;避免全仓库 reformat(除非用户明确要求)。
|
||||
@@ -52,6 +55,7 @@ description:
|
||||
`npx prettier -w <files...>`(以项目脚本为准)
|
||||
|
||||
4. **Guardrails**
|
||||
|
||||
- 只做风格与格式:不改变行为、不改 public API、不做重构。
|
||||
- 如格式化导致 diff 暴涨(文件数/行数过大):先停下,给出原因与两种方案让用户选:
|
||||
1. 仅格式化本次改动文件(推荐默认)
|
||||
|
||||
Reference in New Issue
Block a user