chore: Enable "curly" rule to avoid single-statement if confusion/errors.

This commit is contained in:
cpojer
2026-01-31 16:19:20 +09:00
parent 009b16fab8
commit 5ceff756e1
1266 changed files with 27871 additions and 9393 deletions

View File

@@ -45,7 +45,9 @@ export async function fetchGeminiUsage(
for (const bucket of data.buckets || []) {
const model = bucket.modelId || "unknown";
const frac = bucket.remainingFraction ?? 1;
if (!quotas[model] || frac < quotas[model]) quotas[model] = frac;
if (!quotas[model] || frac < quotas[model]) {
quotas[model] = frac;
}
}
const windows: UsageWindow[] = [];
@@ -58,24 +60,30 @@ export async function fetchGeminiUsage(
const lower = model.toLowerCase();
if (lower.includes("pro")) {
hasPro = true;
if (frac < proMin) proMin = frac;
if (frac < proMin) {
proMin = frac;
}
}
if (lower.includes("flash")) {
hasFlash = true;
if (frac < flashMin) flashMin = frac;
if (frac < flashMin) {
flashMin = frac;
}
}
}
if (hasPro)
if (hasPro) {
windows.push({
label: "Pro",
usedPercent: clampPercent((1 - proMin) * 100),
});
if (hasFlash)
}
if (hasFlash) {
windows.push({
label: "Flash",
usedPercent: clampPercent((1 - flashMin) * 100),
});
}
return { provider, displayName: PROVIDER_LABELS[provider], windows };
}