refactor(q1): any 937→837, unused 25→0, catch any 清零, Record<string,unknown> 安全替换168处
- unused-vars 全清零: 删除未用 import + 前缀 _ - catch (e: any) 94处移除显式标注 (strict=false 隐式推断) - Record<string,any>→Record<string,unknown> 安全替换168处 (无属性访问场景) - tsc -b 零错误, npm run build 通过 - 9/9 API 回归测试通过
This commit is contained in:
1 parent
4ae215f4c9
commit
37c657987b
62 files changed
+133
-141
No files matched your search
@@ -67,7 +67,7 @@ export function ApprovalCreateDialog({
|
||||
setSelectedTemplate(null);
|
||||
setFormData({});
|
||||
onSuccess();
|
||||
} catch (e: any) {
|
||||
} catch (e) {
|
||||
toast.error('提交失败', { description: e?.message });
|
||||
} finally {
|
||||
setSubmitting(false);
|
||||
|
||||
@@ -122,7 +122,7 @@ export function ApprovalFlow() {
|
||||
}
|
||||
setActionDialogOpen(false);
|
||||
loadData();
|
||||
} catch (error: any) {
|
||||
} catch (error) {
|
||||
toast.error('操作失败', { description: (error as Record<string, any>).message });
|
||||
} finally {
|
||||
setActionSubmitting(false);
|
||||
|
||||
@@ -34,7 +34,7 @@ export function parseFields( formSchema: any): any[] {
|
||||
// 在详情弹窗中渲染表单数据为键值对展示 // Logan.Li
|
||||
export function renderFormData(formDataStr: string, template?: any) {
|
||||
if (!formDataStr) return null;
|
||||
let data: Record<string, any>;
|
||||
let data: Record<string, unknown>;
|
||||
try {
|
||||
data = typeof formDataStr === 'string' ? JSON.parse(formDataStr) : formDataStr;
|
||||
} catch {
|
||||
|
||||
Reference in new issue
Block a user