chore: 加 oxlint,现存 19 条 warning 清零
Deploy / deploy (push) Canceled after 0s

原来只有 Prettier,没有任何 lint。根目录加 `bun run lint`(oxlint,覆盖后端、前端、
契约,--deny-warnings:有一条就算失败),CLAUDE.md 常用检查里加上。

现存 19 条顺手清掉:
- 11 处未使用的 import / catch 参数 / 回调参数
- oj/store/problem.ts:`...problem.value?.languages` 展开可能是 undefined
  (外层 if 已经保证非空,去掉 ?.)
- admin/problem/detail.vue:`contestId = contestId` 自赋值,删掉
- judge/sql/engine.ts:注释里的 `/*x*/` 示例原来靠零宽空格防止提前闭合注释,
  改成 `*\/`
- 其余:多余的 !!、new Array(n)、展开里多余的 `|| {}`

两边类型检查、前端构建、后端单二进制编译都过。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
xuyueandClaude Opus 5.5 committed 2026-09-27 15:25:27 +08:00
1 parent 83b9d23c68
commit f8b04af4ea
20 files changed
+61 -23

No files matched your search

+1
View File
@@ -58,6 +58,7 @@ bun run --filter '@oj2/api' check:ast # AST 节点类型检查,升级
cd apps/web && bun run type-check # 前端类型检查
cd apps/web && bun run build # 前端构建
bun run fmt # Prettier,全仓一把(只在根目录有)
bun run lint # oxlint,全仓一把,有一条 warning 就算失败
```
**格式化是全仓一套 Prettier**,配置只有根目录的 `.prettierrc.toml`(`semi=false`,