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:
@@ -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 };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user