Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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>