Files
AskaEth 7f9701c465 fix: 审查修复波次(P0x4 + P1x30+)
- domain/rules: 计分与排名解耦、破纪录按组别、tieBreak 生效、调整分不丢、移除 aggregate 假能力
- realtime: 新建 internal/dto,快照三项契约对齐,/ws 只认会话身份
- httpapi: 流水幂等、standings 整表载荷、广播接线、强制改密、XFF 防伪造、records 写入、审计、赛事包内容、发布前备份、result.points、实例列表
- web: FormData 上传、YAML 解析、快照归一化、大屏解析层、bootstrap 降级、访客判定、主题切换
- console: 优雅关闭握手、中文化、免验证改管理员账号、选屏与日志轮转修复
- docs: 用户文档三份 + README
- 主代理: 破纪录加分接线(levels 未加载导致恒 0)
2026-09-09 21:06:40 +08:00

39 lines
1.2 KiB
JavaScript

'use strict'
const { spawnSync } = require('child_process')
const fs = require('fs')
const path = require('path')
// 跨平台的语法检查:原来 package.json 里的 `for f in $(find ...)` 只在 POSIX shell 下能用,
// Windows 构建机上直接报错,这里改用 Node 递归遍历 + node --check。
const ROOT = path.resolve(__dirname, '..')
const SKIP_DIRS = new Set(['node_modules', '.git'])
function collect(dir, files = []) {
for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
if (entry.isDirectory()) {
if (SKIP_DIRS.has(entry.name)) continue
collect(path.join(dir, entry.name), files)
} else if (entry.isFile() && entry.name.endsWith('.js')) {
files.push(path.join(dir, entry.name))
}
}
return files
}
const files = collect(ROOT).sort()
const failed = []
for (const file of files) {
const result = spawnSync(process.execPath, ['--check', file], { stdio: 'inherit' })
if (result.status !== 0) failed.push(file)
}
if (failed.length) {
console.error(`\n语法检查失败 ${failed.length}/${files.length} 个文件:`)
for (const file of failed) console.error(` ${path.relative(ROOT, file)}`)
process.exit(1)
}
console.log(`语法检查通过:${files.length} 个文件`)