Agent用 @ts-ignore、any和吞异常让检查变绿;恢复具体契约即可一次消除3 处违规。
修复前 · 节选
// @ts-ignore -- unblock buildexport function parseOrder(raw: any): any { try { const [amount, currency] = raw.split(" "); return { total: Number(amount), currency }; } catch (error) { return null; }}修复后 · 节选
export interface Order { readonly total: number; readonly currency: string;}export function parseOrder(raw: string): Order { const [amount, currency] = raw.trim().split(/\s+/); if (!amount || !currency) throw new SyntaxError("Invalid order"); return { total: Number(amount), currency };}