@@ -48,9 +48,11 @@ bun test src/utils/__tests__/hash.test.ts # run single file
4848bun test --coverage # with coverage report
4949
5050# Lint & Format (Biome)
51- bun run lint # check only
52- bun run lint:fix # auto-fix
53- bun run format # format all src/
51+ bun run lint # lint check (全项目)
52+ bun run lint:fix # auto-fix lint issues
53+ bun run format # format all (全项目)
54+ bun run check # lint + format check (全项目)
55+ bun run check:fix # lint + format auto-fix
5456
5557# Health check
5658bun run health
@@ -82,9 +84,11 @@ bun run docs:dev
8284- ** Dev mode** : ` scripts/dev.ts ` 通过 Bun ` -d ` flag 注入 ` MACRO.* ` defines,运行 ` src/entrypoints/cli.tsx ` 。默认启用全部 feature。
8385- ** Module system** : ESM (` "type": "module" ` ), TSX with ` react-jsx ` transform.
8486- ** Monorepo** : Bun workspaces — 15 个 workspace packages + 若干辅助目录 in ` packages/ ` resolved via ` workspace:* ` 。
85- - ** Lint/Format** : Biome (` biome.json ` )。` bun run lint ` / ` bun run lint:fix ` / ` bun run format ` 。
87+ - ** Lint/Format** : Biome (` biome.json ` )。覆盖 ` src/ ` 、` scripts/ ` 、` packages/ ` 全项目(含 ` packages/@ant/ ` )。` bun run lint ` / ` bun run lint:fix ` / ` bun run format ` / ` bun run check ` / ` bun run check:fix ` 。42 条规则因 decompiled 代码被关闭,仅保留 ` recommended ` 基线。
88+ - ** Pre-commit** : husky + lint-staged。提交时自动对暂存文件执行 ` biome check --fix ` (TS/JS)和 ` biome format --write ` (JSON)。
89+ - ** CI Lint** : ` ci.yml ` 在依赖安装后、类型检查前执行 ` bunx biome ci . ` ,lint 或格式化不达标则 CI 失败。
8690- ** Defines** : 集中管理在 ` scripts/defines.ts ` 。当前版本 ` 2.1.888 ` 。
87- - ** CI** : GitHub Actions — ` ci.yml ` (构建+ 测试)、` release-rcs.yml ` (RCS 发布)、` update-contributors.yml ` (自动更新贡献者)。
91+ - ** CI** : GitHub Actions — ` ci.yml ` (lint + 构建 + 测试)、` release-rcs.yml ` (RCS 发布)、` update-contributors.yml ` (自动更新贡献者)。
8892
8993### Entry & Bootstrap
9094
@@ -328,7 +332,9 @@ bun run typecheck
328332- ** ` src/ ` path alias** — tsconfig maps ` src/* ` to ` ./src/* ` . Imports like ` import { ... } from 'src/utils/...' ` are valid.
329333- ** MACRO defines** — 集中管理在 ` scripts/defines.ts ` 。Dev mode 通过 ` bun -d ` 注入,build 通过 ` Bun.build({ define }) ` 注入。修改版本号等常量只改这个文件。
330334- ** 构建产物兼容 Node.js** — ` build.ts ` 会自动后处理 ` import.meta.require ` ,产物可直接用 ` node dist/cli.js ` 运行。
331- - ** Biome 配置** — 大量 lint 规则被关闭(decompiled 代码不适合严格 lint)。` .tsx ` 文件用 120 行宽 + 强制分号;其他文件 80 行宽 + 按需分号。
335+ - ** Biome 配置** — 42 条 lint 规则因 decompiled 代码被关闭,仅保留 ` recommended ` 基线。格式化覆盖全项目(` src/ ` 、` scripts/ ` 、` packages/ ` ,含 ` packages/@ant/ ` )。` .tsx ` 文件用 120 行宽 + 强制分号;其他文件 80 行宽 + 按需分号。JSON 格式化已启用。` .editorconfig ` 与 Biome 配置对齐(2-space 缩进)。修改任何代码后应运行 ` bun run check ` 确认无 lint/格式问题,pre-commit hook 会自动拦截不合格提交。
336+ - ** tsc 与 Biome 冲突处理** — 当 tsc 要求声明属性(赋值使用)但 biome 报 ` noUnusedPrivateClassMembers ` (只写不读)时,用 ` // biome-ignore lint/correctness/noUnusedPrivateClassMembers: <原因> ` 抑制 lint 警告,保留类型声明。` biome ci ` 必须零 warnings。
337+ - ** ` @ts-expect-error ` 维护** — 只在下方代码确实有类型错误时保留 ` @ts-expect-error ` 。如果类型系统已更新导致 directive 变为 unused(TS2578),直接移除注释。MACRO 替换产生的永假比较(如 ` 'production' === 'development' ` )仍需保留 ` @ts-expect-error ` 。
332338- ** Ink 框架在 ` packages/@ant/ink/ ` ** — 不是 ` src/ink/ ` (该目录不存在)。Ink 相关的组件、hooks、keybindings 都在 packages 中。
333339- ** Provider 优先级** — ` modelType ` 参数 > 环境变量 > 默认 ` firstParty ` 。新增 provider 需在 ` src/utils/model/providers.ts ` 注册。
334340
0 commit comments