chore: 格式化、lint、任务编排换成 Vite+

Prettier + oxlint + 散在各包的检查脚本,收成 vite-plus(1.0.0-rc.1)一套,配置只有
根目录 vite.config.ts 一份:

- fmt(Oxfmt,替掉 Prettier):semi: false、printWidth: 80。Vite+ 下 Oxfmt 默认 100 列,
  不显式写 80 就是 267 个文件的 diff。范围和原来 Prettier 一致,只管代码 ——
  md / yml / json / toml 排掉(文档表格、compose 注释是手排的),db/meta 快照和
  unplugin 的两个 .d.ts 照旧排掉。.prettierrc.toml / .prettierignore 删除
- lint(Oxlint,vite-plus 自带同版本 1.85.0,单独的 oxlint 依赖删掉):denyWarnings。
  范围从三个 src 目录扩到全仓,多抓出 apps/web/vite.config.ts 里没人用的 loadEnv,删掉
- run.tasks:typecheck:api / typecheck:web / check:routes / check:ast 四个检查 + 汇总的
  verify(vp check + 前四个)。一律经 `bun run <脚本>` 调 —— 任务定义在根包,PATH 是根
  目录的 node_modules/.bin,直接写 tsc 拿到的是根目录的 TS 5.9 而不是 apps/api 的 TS 7,
  实测报一堆假错
- 根脚本:fmt → vp fmt,lint → vp lint,新增 check → vp check。verify 不设同名脚本
  (Vite+ 不许任务和脚本重名),用 `bunx vp run verify`
- dev 仍是 bun run --parallel:常驻进程,缓存用不上

实测:verify 首跑全过;第二遍 5/5 命中缓存、0.25 秒;往 apps/api 塞一个类型错误,
只有 typecheck:api 和 check:routes 重跑并失败、前端直接命中缓存;.vue 里塞类型错误
同样被抓到;denyWarnings 下有一条 warning 退出码就是 1。前端构建、后端单二进制编译照常。

代价:vite-plus 带 vitest、tsgolint 等约 120MB 依赖,只进 Docker builder 阶段、不进运行
镜像,CI 的 --prebuilt 部署不受影响。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
xuyueandClaude Opus 5.5 committed 2026-09-27 15:37:23 +08:00
1 parent f8b04af4ea
commit 44295188b9
8 files changed
+352 -53

No files matched your search

+3 -3
View File
@@ -28,9 +28,9 @@ bun run build # 生产构建
通过**——那个 tsconfig 是 `files: []` + references 的壳,真正的配置在
`tsconfig.app.json`(0.2 秒跑完就是没在检查的信号);`vite build` 也不做类型检查。
不写测试(沿用项目约定),验证靠实跑。lint 只有 Prettier,**脚本在仓库根目录**
(`cd ../.. && bun run fmt`,一把把后端、契约、前端全格式化)—— 前端这边原来那个
只管 `apps/web` 的 `fmt` 已经删掉,配置也收到了根目录的 `.prettierrc.toml`。
不写测试(沿用项目约定),验证靠实跑。格式化和 lint 走 Vite+,**脚本在仓库根目录**
(`cd ../.. && bun run fmt` / `bun run lint`,一把把后端、契约、前端全过一遍),配置在
根目录的 `vite.config.ts`,不是本目录那份(本目录的 `vite.config.ts` 只管前端构建)。
## Architecture