docs: 补充 lint/format 开发文档
This commit is contained in:
@@ -47,6 +47,24 @@ bun src/cli.ts help init # 查看 init 命令帮助
|
||||
bun src/cli.ts version # 查看版本号
|
||||
```
|
||||
|
||||
### 代码质量
|
||||
|
||||
项目使用 oxlint 进行静态分析,oxfmt 进行代码格式化,提交时通过 husky + lint-staged 自动检查。
|
||||
|
||||
```bash
|
||||
bun lint # 静态分析所有文件
|
||||
bun format # 格式化所有文件(写回)
|
||||
bun format:check # 检查格式不写回(CI 用)
|
||||
bun check # 一键 lint + 格式检查
|
||||
```
|
||||
|
||||
**配置文件:**
|
||||
|
||||
- `.oxlintrc.json` — oxlint 规则配置(correctness + suspicious 全开,style 选开)
|
||||
- `.oxfmtrc.json` — oxfmt 格式设置(双引号、分号、尾逗号、2 空格缩进、100 行宽、LF 换行)
|
||||
|
||||
**pre-commit hook:** 提交时自动对 staged 文件运行 lint 和格式化,lint 失败会阻止提交。
|
||||
|
||||
## CLI 交互架构
|
||||
|
||||
### 子命令
|
||||
|
||||
Reference in New Issue
Block a user