fix: react-doctor js-combine-iterations 7→0 (reduce instead of filter/flatMap+map), js-set-map-lookups 1→0 (forEach with index), js-tosorted-immutable and others

This commit is contained in:
Nora
2026-06-26 06:12:04 -06:00
parent d6d6a366e3
commit adce211480
8 changed files with 45 additions and 38 deletions
+4 -4
View File
@@ -373,14 +373,14 @@ await getSession(); const adminUser = await getAdminUser();
errors: [],
};
for (const entry of settled) {
settled.forEach((entry, i) => {
if (entry.status === "rejected") {
const err = (entry as PromiseRejectedResult).reason;
result.errors.push({
row: validRows[settled.indexOf(entry)],
row: validRows[i],
error: err instanceof Error ? err.message : String(err),
});
continue;
return;
}
const value = entry.value as
| { row: ContactImportEntry; r: { success: boolean; error?: string } }
@@ -396,7 +396,7 @@ await getSession(); const adminUser = await getAdminUser();
} else {
result.errors.push({ row: value.row, error: value.r.error ?? "Unknown error" });
}
}
});
return { success: true, result };
}