iter(g194): 审计 json 输出命中明细
This commit is contained in:
@@ -104,7 +104,13 @@ export function visualAudit(args, root) {
|
||||
}
|
||||
if (args.includes('--json')) {
|
||||
const baseline = readBaseline(root);
|
||||
console.log(JSON.stringify({ file: UI_CSS_REL, total, counts: result.counts, baseline: baseline?.counts ?? null }, null, 2));
|
||||
// hits 是「哪一行踩了哪条规则」的机器可读明细:此前排查只能手写 node -e 调 scanSource,
|
||||
// Agent 拿到计数却定位不到行,等于每轮都要重写一遍探针。
|
||||
const hits = Object.fromEntries(KIND_META.map((meta) => [
|
||||
meta.key,
|
||||
(result.hits[meta.key] ?? []).map((hit) => ({ line: hit.line, prop: hit.prop, value: hit.value, hint: meta.hint })),
|
||||
]));
|
||||
console.log(JSON.stringify({ file: UI_CSS_REL, total, counts: result.counts, baseline: baseline?.counts ?? null, hits }, null, 2));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user