From 0f2b548138b5e4f092ca9d7fccf52901cf0522d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Sun, 28 Jun 2026 19:26:16 +0200 Subject: [PATCH] style: apply prettier 3.9.1 formatting Mechanical reflow from the prettier 3.9.1 bump; no behaviour change. --- docs/integrations/data-import.md | 8 ++--- src/app/api/ai/test/route.ts | 5 +--- src/app/api/auth/check-user/route.ts | 5 +--- .../dashboard/summary/__tests__/route.test.ts | 3 +- src/app/api/insights/generate/route.ts | 7 +++-- src/app/api/measurements/batch/route.ts | 3 +- src/app/page.tsx | 6 ++-- src/components/admin/_shared.tsx | 6 +--- src/components/charts/health-chart.tsx | 9 ++---- src/components/charts/mood-chart.tsx | 3 +- src/components/cycle/cycle-phase-crosstab.tsx | 9 +----- src/components/cycle/types.ts | 11 ++----- .../dashboard/quick-entry-sheets.tsx | 5 +--- src/components/illness/types.ts | 5 +--- .../coach-panel/guided-questions-machine.ts | 6 +--- .../insights/coach-panel/message-thread.tsx | 3 +- .../glucose/glucose-clinical-panel.tsx | 3 +- src/components/insights/health-score-card.tsx | 6 +--- src/components/insights/hero-strip.tsx | 6 +--- .../insights/insights-tab-strip.tsx | 7 +---- .../mood/mood-factor-metric-crosstab.tsx | 8 +---- .../insights/mood/mood-stability-tile.tsx | 5 +--- .../insights/mood/mood-time-of-day-chart.tsx | 3 +- .../insights/mood/mood-weekday-chart.tsx | 3 +- .../insights/recommendation-card.tsx | 3 +- .../insights/use-insights-advisor.ts | 6 +--- src/components/labs/lab-biomarker-chart.tsx | 3 +- .../__tests__/use-medication-intake.test.ts | 3 +- .../medications/medication-table.tsx | 5 +--- .../scheduling/schedule-times-editor.tsx | 4 +-- .../medications/sections/settings-section.tsx | 4 +-- src/components/settings/_info-tile.tsx | 6 +--- .../account-section/account-section-utils.ts | 3 +- .../settings/integration-status-pill.tsx | 6 +--- .../integrations/connections-panel.tsx | 3 +- .../integrations/setup-guide-link.tsx | 7 +---- .../settings/integrations/shared.tsx | 13 ++------ .../settings/notification-status-card.tsx | 5 +--- src/lib/ai/coach/suggest-gate.ts | 3 +- src/lib/ai/coach/tools/executor.ts | 6 ++-- src/lib/ai/codex-oauth.ts | 3 +- src/lib/ai/medical-references.ts | 6 +--- src/lib/ai/types.ts | 30 +++++++------------ src/lib/analytics/compliance.ts | 6 +--- src/lib/analytics/merge-slim-thick.ts | 17 +++++------ src/lib/analytics/source-priority.ts | 6 ++-- src/lib/auth/__tests__/refresh-token.test.ts | 4 +-- src/lib/auth/mfa/webauthn.ts | 8 +---- src/lib/auth/passkey.ts | 8 +---- src/lib/auth/refresh-token.ts | 5 +--- src/lib/consent/web-grant.ts | 3 +- src/lib/cycle/phase-crosstab.ts | 9 +----- src/lib/cycle/types.ts | 16 ++-------- src/lib/fitbit/client.ts | 7 +---- src/lib/gamification/achievements.ts | 7 +---- src/lib/http/read-capped.ts | 3 +- src/lib/idempotency.ts | 4 +-- src/lib/illness/gate.ts | 3 +- src/lib/insights/comprehensive-generate.ts | 7 +++-- src/lib/insights/derived/chronotype.ts | 6 +--- src/lib/insights/derived/sleep-rhythm.ts | 7 +---- src/lib/insights/derived/types.ts | 7 +---- src/lib/insights/features.ts | 8 +---- src/lib/insights/mood-aggregates.ts | 5 +--- .../insights/narrative/period-narrative.ts | 3 +- .../integrations/http-status-classifier.ts | 5 +--- src/lib/integrations/status.ts | 6 +--- src/lib/jobs/coach-plan-review.ts | 6 +--- src/lib/jobs/cycle-reminder.ts | 4 +-- src/lib/jobs/insight-pregenerate.ts | 6 +--- src/lib/labs/ocr-upload.ts | 5 +--- src/lib/mcp/oauth/clients.ts | 5 +--- src/lib/mcp/tools.ts | 3 +- .../consolidation-scan-paged.test.ts | 3 +- src/lib/measurements/apple-health-mapping.ts | 6 +--- src/lib/measurements/consolidation-base.ts | 3 +- .../import-apple-health-export.ts | 7 +---- src/lib/medications/glp1-knowledge.ts | 6 +--- .../medications/scheduling/dose-history.ts | 7 +---- src/lib/medications/side-effects/taxonomy.ts | 6 +--- src/lib/modules/gate.ts | 3 +- src/lib/mood/icon-catalog.ts | 8 +---- src/lib/polar/client.ts | 4 +-- src/lib/reference-ranges.ts | 5 +--- src/lib/sync/cursor.ts | 6 +--- src/lib/targets/glucose-targets.ts | 5 +--- src/lib/tz/format.ts | 5 +--- src/lib/validations/inbound-documents.ts | 4 +-- src/lib/withings/response-classifier.ts | 5 +--- .../analytics-bp-aggregate-paged.test.ts | 3 +- 90 files changed, 123 insertions(+), 406 deletions(-) diff --git a/docs/integrations/data-import.md b/docs/integrations/data-import.md index a128097a8..e01d4247d 100644 --- a/docs/integrations/data-import.md +++ b/docs/integrations/data-import.md @@ -36,12 +36,8 @@ arrays: ```json { - "measurements": [ - /* … */ - ], - "moodEntries": [ - /* … */ - ] + "measurements": [/* … */], + "moodEntries": [/* … */] } ``` diff --git a/src/app/api/ai/test/route.ts b/src/app/api/ai/test/route.ts index aae4bbcb6..be0432a5f 100644 --- a/src/app/api/ai/test/route.ts +++ b/src/app/api/ai/test/route.ts @@ -123,10 +123,7 @@ export const POST = apiHandler(async (request: NextRequest) => { * legacy / unmapped code. Secret-free by construction. */ type TestFailureCode = - | "credentials" - | "rate_limited" - | "server_error" - | "unreachable"; + "credentials" | "rate_limited" | "server_error" | "unreachable"; /** * Map an upstream provider failure to a human-readable, secret-free diff --git a/src/app/api/auth/check-user/route.ts b/src/app/api/auth/check-user/route.ts index c79b0a96c..56694d8e0 100644 --- a/src/app/api/auth/check-user/route.ts +++ b/src/app/api/auth/check-user/route.ts @@ -53,10 +53,7 @@ const bodySchema = z.object({ }); export type CheckUserBranch = - | "not_found" - | "passkey_only" - | "email_fallback" - | "exists"; + "not_found" | "passkey_only" | "email_fallback" | "exists"; export const POST = apiHandler(async (request: NextRequest) => { // v1.4.43 W13 M-4 — tighter shared bucket on trust-chain misconfig. diff --git a/src/app/api/dashboard/summary/__tests__/route.test.ts b/src/app/api/dashboard/summary/__tests__/route.test.ts index 0080f84b5..5160dd652 100644 --- a/src/app/api/dashboard/summary/__tests__/route.test.ts +++ b/src/app/api/dashboard/summary/__tests__/route.test.ts @@ -175,8 +175,7 @@ describe("GET /api/dashboard/summary", () => { // The previous shape emitted "Gewicht" / "kg" / "Schritte" verbatim, // which injected DE into an English iOS UI. const weightCard = body.data.metrics.find((m) => m.id === "weight") as - | { titleKey: string; unitKey: string } - | undefined; + { titleKey: string; unitKey: string } | undefined; expect(weightCard?.titleKey).toBe("dashboard.metric.title.weight"); expect(weightCard?.unitKey).toBe("dashboard.metric.unit.weight"); expect( diff --git a/src/app/api/insights/generate/route.ts b/src/app/api/insights/generate/route.ts index 5f15fe2da..5dcf2081c 100644 --- a/src/app/api/insights/generate/route.ts +++ b/src/app/api/insights/generate/route.ts @@ -226,9 +226,10 @@ async function buildComparisonSnapshotForUser( orderBy: { measuredAt: "asc" }, select: { measuredAt: true, value: true }, }); - dataPoints = measurements.map( - (m): DataPoint => ({ date: m.measuredAt, value: m.value }), - ); + dataPoints = measurements.map((m): DataPoint => ({ + date: m.measuredAt, + value: m.value, + })); } const summary = summarize(dataPoints); const baselineAvg = diff --git a/src/app/api/measurements/batch/route.ts b/src/app/api/measurements/batch/route.ts index bb9e9b1d6..3748b429c 100644 --- a/src/app/api/measurements/batch/route.ts +++ b/src/app/api/measurements/batch/route.ts @@ -542,8 +542,7 @@ async function postBatch(request: NextRequest): Promise { unit: p.row.unit as string, measuredAt: p.row.measuredAt as Date, externalSourceVersion: p.row.externalSourceVersion as - | string - | null, + string | null, deviceType: p.row.deviceType as Prepared["row"]["deviceType"], sleepStage: p.row.sleepStage as Prepared["row"]["sleepStage"], }, diff --git a/src/app/page.tsx b/src/app/page.tsx index e610e4940..4bcb6a2e5 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -205,8 +205,7 @@ export default function DashboardPage() { bpInTargetCount90: snap.extras?.bpInTargetCount90 ?? null, bpInTargetSpanDays90: snap.extras?.bpInTargetSpanDays90 ?? null, glucoseByContext: snap.extras?.glucoseByContext as - | Record - | undefined, + Record | undefined, }; } // v1.4.39.3 — the merge moved to `mergeSlimAndThickAnalytics` so @@ -235,8 +234,7 @@ export default function DashboardPage() { bpInTargetCount90: merged.bpInTargetCount90, bpInTargetSpanDays90: merged.bpInTargetSpanDays90, glucoseByContext: merged.glucoseByContext as - | Record - | undefined, + Record | undefined, }; }, [ snapshotEnabled, diff --git a/src/components/admin/_shared.tsx b/src/components/admin/_shared.tsx index da0481bb3..8f20921a2 100644 --- a/src/components/admin/_shared.tsx +++ b/src/components/admin/_shared.tsx @@ -279,11 +279,7 @@ export function useAuthActionLabels(): Record { * mirroring the convention established by `useAuthActionLabels`. */ export type AuthProvider = - | "password" - | "passkey" - | "api_token" - | "withings" - | "unknown"; + "password" | "passkey" | "api_token" | "withings" | "unknown"; export function providerForAction(action: string): AuthProvider { if ( diff --git a/src/components/charts/health-chart.tsx b/src/components/charts/health-chart.tsx index 60f97d96a..7d667dc6b 100644 --- a/src/components/charts/health-chart.tsx +++ b/src/components/charts/health-chart.tsx @@ -494,8 +494,7 @@ export function resolveVerticalMarkerPositions( export function resolveAnnotationPositions( annotations: - | Array<{ date: string; label: string; color: string }> - | undefined, + Array<{ date: string; label: string; color: string }> | undefined, chartData: Array<{ timestamp: number }> | undefined, ): ResolvedAnnotation[] { if (!annotations || !chartData || chartData.length === 0) return []; @@ -2021,8 +2020,7 @@ export function HealthChart({ // current ↔ compare values come from the SAME // payload object. const hoverPoint = payload[0]?.payload as - | ChartDataPoint - | undefined; + ChartDataPoint | undefined; for (const item of payload) { if (typeof item.value !== "number") continue; const dataKey = String(item.dataKey ?? ""); @@ -2047,8 +2045,7 @@ export function HealthChart({ const compareValue = effectiveCompareBaseline !== "none" && hoverPoint ? (hoverPoint[`${dataKey}_compare`] as - | number - | undefined) + number | undefined) : undefined; if ( effectiveCompareBaseline !== "none" && diff --git a/src/components/charts/mood-chart.tsx b/src/components/charts/mood-chart.tsx index e04814a90..c9dfa3a1a 100644 --- a/src/components/charts/mood-chart.tsx +++ b/src/components/charts/mood-chart.tsx @@ -840,8 +840,7 @@ export function MoodChart({ const dateLabel = ts ? tzFmt.date(new Date(ts)) : ""; const rows: RichTooltipRow[] = []; const hoverPoint = payload[0]?.payload as - | ChartDataPoint - | undefined; + ChartDataPoint | undefined; for (const item of payload) { if (typeof item.value !== "number") continue; const dataKey = String(item.dataKey ?? ""); diff --git a/src/components/cycle/cycle-phase-crosstab.tsx b/src/components/cycle/cycle-phase-crosstab.tsx index 69c9bbe07..f2badb1aa 100644 --- a/src/components/cycle/cycle-phase-crosstab.tsx +++ b/src/components/cycle/cycle-phase-crosstab.tsx @@ -19,14 +19,7 @@ import { cn } from "@/lib/utils"; */ export type CyclePhaseCrosstabDisplay = - | "hours" - | "steps" - | "bpm" - | "ms" - | "kg" - | "celsius" - | "glucose" - | "mood"; + "hours" | "steps" | "bpm" | "ms" | "kg" | "celsius" | "glucose" | "mood"; export type CyclePhaseCrosstabConfidence = "low" | "medium" | "high"; diff --git a/src/components/cycle/types.ts b/src/components/cycle/types.ts index bbc799610..bef523029 100644 --- a/src/components/cycle/types.ts +++ b/src/components/cycle/types.ts @@ -10,17 +10,10 @@ export type CyclePhase = "MENSTRUAL" | "FOLLICULAR" | "OVULATORY" | "LUTEAL"; export type FlowLevel = "NONE" | "SPOTTING" | "LIGHT" | "MEDIUM" | "HEAVY"; export type OvulationTest = - | "NEGATIVE" - | "POSITIVE_LH_SURGE" - | "ESTROGEN_SURGE" - | "INDETERMINATE"; + "NEGATIVE" | "POSITIVE_LH_SURGE" | "ESTROGEN_SURGE" | "INDETERMINATE"; export type CervicalMucus = - | "DRY" - | "STICKY" - | "CREAMY" - | "WATERY" - | "EGG_WHITE"; + "DRY" | "STICKY" | "CREAMY" | "WATERY" | "EGG_WHITE"; export type CycleGoal = | "GENERAL_HEALTH" diff --git a/src/components/dashboard/quick-entry-sheets.tsx b/src/components/dashboard/quick-entry-sheets.tsx index 0eeb74073..27a990920 100644 --- a/src/components/dashboard/quick-entry-sheets.tsx +++ b/src/components/dashboard/quick-entry-sheets.tsx @@ -27,10 +27,7 @@ import { MedicationIntakeQuickAdd } from "@/components/dashboard/medication-inta import { useTranslations } from "@/lib/i18n/context"; export type QuickEntryDialog = - | "measurement" - | "mood" - | "medicationIntake" - | null; + "measurement" | "mood" | "medicationIntake" | null; /** * v1.11.3 F3 — guard the quick-entry sheets against an accidental diff --git a/src/components/illness/types.ts b/src/components/illness/types.ts index 4f87580e5..64967cb5a 100644 --- a/src/components/illness/types.ts +++ b/src/components/illness/types.ts @@ -13,10 +13,7 @@ export type IllnessType = | "OTHER"; export type IllnessLifecycle = - | "ACUTE" - | "CHRONIC_ONGOING" - | "RECURRING" - | "FLARE"; + "ACUTE" | "CHRONIC_ONGOING" | "RECURRING" | "FLARE"; export interface IllnessSymptomSelection { key: string; diff --git a/src/components/insights/coach-panel/guided-questions-machine.ts b/src/components/insights/coach-panel/guided-questions-machine.ts index 33e3e264d..a30e70e41 100644 --- a/src/components/insights/coach-panel/guided-questions-machine.ts +++ b/src/components/insights/coach-panel/guided-questions-machine.ts @@ -36,11 +36,7 @@ /** Lifecycle of one answered question's adopt offer. */ export type GuidedAdoption = - | "pending" - | "adopted" - | "duplicate" - | "declined" - | "failed"; + "pending" | "adopted" | "duplicate" | "declined" | "failed"; export interface GuidedOutcome { /** Index of the question in the session snapshot (progress label). */ diff --git a/src/components/insights/coach-panel/message-thread.tsx b/src/components/insights/coach-panel/message-thread.tsx index 76f74a65d..686bd83d3 100644 --- a/src/components/insights/coach-panel/message-thread.tsx +++ b/src/components/insights/coach-panel/message-thread.tsx @@ -1046,8 +1046,7 @@ interface ChatBubbleProps { * bubble falls back to that so the card survives reload. */ suggestedAction?: - | import("@/lib/ai/coach/suggest-action").CoachSuggestedAction - | null; + import("@/lib/ai/coach/suggest-action").CoachSuggestedAction | null; providerType?: string | null; inProgress?: boolean; errorCode?: string | null; diff --git a/src/components/insights/glucose/glucose-clinical-panel.tsx b/src/components/insights/glucose/glucose-clinical-panel.tsx index b27317673..26dc807b6 100644 --- a/src/components/insights/glucose/glucose-clinical-panel.tsx +++ b/src/components/insights/glucose/glucose-clinical-panel.tsx @@ -72,8 +72,7 @@ export function GlucoseClinicalPanel() { if (!clinical) return null; const byContext = query.data?.glucoseByContext as - | Record - | undefined; + Record | undefined; const formatGlucoseValue = (mgdl: number): string => { const v = convertGlucose(mgdl, glucoseUnit); diff --git a/src/components/insights/health-score-card.tsx b/src/components/insights/health-score-card.tsx index 206afedaf..21a657341 100644 --- a/src/components/insights/health-score-card.tsx +++ b/src/components/insights/health-score-card.tsx @@ -47,11 +47,7 @@ export type HealthScoreBand = "green" | "yellow" | "red"; * client doesn't pull a heavy analytics import for one string union). */ export type HealthScoreComponentSource = - | "manual" - | "withings" - | "appleHealth" - | "mixed" - | "none"; + "manual" | "withings" | "appleHealth" | "mixed" | "none"; export interface HealthScoreCardComponent { value: number | null; diff --git a/src/components/insights/hero-strip.tsx b/src/components/insights/hero-strip.tsx index 87ed0a2ab..8248d19c8 100644 --- a/src/components/insights/hero-strip.tsx +++ b/src/components/insights/hero-strip.tsx @@ -23,11 +23,7 @@ import type { DailyBriefing as DailyBriefingPayload } from "@/lib/ai/schema"; * `insights.derived.composite.READINESS.component.{key}` labels. */ export type ReadinessContributorKey = - | "rhr" - | "hrv" - | "sleep" - | "respiratory" - | "mood"; + "rhr" | "hrv" | "sleep" | "respiratory" | "mood"; /** * Insights redesign hero strip. diff --git a/src/components/insights/insights-tab-strip.tsx b/src/components/insights/insights-tab-strip.tsx index 5a9559166..75159f92a 100644 --- a/src/components/insights/insights-tab-strip.tsx +++ b/src/components/insights/insights-tab-strip.tsx @@ -86,12 +86,7 @@ export interface InsightsTabStripProps { * mounts / no regenerate) falls back to the prior unconditional success. */ regenerateOutcome?: - | "fresh" - | "empty" - | "rate-limited" - | "timeout" - | "no-provider" - | null; + "fresh" | "empty" | "rate-limited" | "timeout" | "no-provider" | null; /** * v1.4.27 F19 — analytics + event-driven availability inputs the * gating helper reads. When omitted the strip falls back to its diff --git a/src/components/insights/mood/mood-factor-metric-crosstab.tsx b/src/components/insights/mood/mood-factor-metric-crosstab.tsx index bec66ed6f..af67d7f05 100644 --- a/src/components/insights/mood/mood-factor-metric-crosstab.tsx +++ b/src/components/insights/mood/mood-factor-metric-crosstab.tsx @@ -21,13 +21,7 @@ import type { MoodInfluenceConfidence } from "./mood-tag-influence"; */ export type MoodFactorCrosstabDisplay = - | "hours" - | "score" - | "steps" - | "bpm" - | "ms" - | "kg" - | "mmHg"; + "hours" | "score" | "steps" | "bpm" | "ms" | "kg" | "mmHg"; export type MoodFactorCrosstabMode = "sameDay" | "nextDay"; export interface MoodFactorMetricCrosstabRow { diff --git a/src/components/insights/mood/mood-stability-tile.tsx b/src/components/insights/mood/mood-stability-tile.tsx index 32da9e524..b2c9a9f2f 100644 --- a/src/components/insights/mood/mood-stability-tile.tsx +++ b/src/components/insights/mood/mood-stability-tile.tsx @@ -18,10 +18,7 @@ import { useTranslations } from "@/lib/i18n/context"; */ export type MoodStabilityBand = - | "verySteady" - | "steady" - | "variable" - | "veryVariable"; + "verySteady" | "steady" | "variable" | "veryVariable"; export interface MoodStabilityData { score: number; diff --git a/src/components/insights/mood/mood-time-of-day-chart.tsx b/src/components/insights/mood/mood-time-of-day-chart.tsx index 2a8769fc0..fd3a02ec7 100644 --- a/src/components/insights/mood/mood-time-of-day-chart.tsx +++ b/src/components/insights/mood/mood-time-of-day-chart.tsx @@ -118,8 +118,7 @@ export function MoodTimeOfDayChart({ labelStyle={{ color: "var(--dracula-fg)" }} formatter={(_value, _name, item) => { const payload = item?.payload as - | { avgScore: number | null; count: number } - | undefined; + { avgScore: number | null; count: number } | undefined; if (!payload || payload.avgScore == null) { return [t("insights.mood.weekdayNoData"), ""]; } diff --git a/src/components/insights/mood/mood-weekday-chart.tsx b/src/components/insights/mood/mood-weekday-chart.tsx index 582d6c74f..f66233759 100644 --- a/src/components/insights/mood/mood-weekday-chart.tsx +++ b/src/components/insights/mood/mood-weekday-chart.tsx @@ -125,8 +125,7 @@ export function MoodWeekdayChart({ weekday }: { weekday: MoodWeekdayRow[] }) { labelStyle={{ color: "var(--dracula-fg)" }} formatter={(_value, _name, item) => { const payload = item?.payload as - | { avgScore: number | null; count: number } - | undefined; + { avgScore: number | null; count: number } | undefined; if (!payload || payload.avgScore == null) { return [t("insights.mood.weekdayNoData"), ""]; } diff --git a/src/components/insights/recommendation-card.tsx b/src/components/insights/recommendation-card.tsx index 309760bc9..f114b637a 100644 --- a/src/components/insights/recommendation-card.tsx +++ b/src/components/insights/recommendation-card.tsx @@ -217,8 +217,7 @@ function RationaleCard({ }: { rationale: InsightRecommendationRationale; metricSource: - | { type: string; timeRange: string; summary: string } - | undefined; + { type: string; timeRange: string; summary: string } | undefined; referenceId: string | undefined; confidence: number | undefined; locale: Locale; diff --git a/src/components/insights/use-insights-advisor.ts b/src/components/insights/use-insights-advisor.ts index 38594d6f5..d271742df 100644 --- a/src/components/insights/use-insights-advisor.ts +++ b/src/components/insights/use-insights-advisor.ts @@ -147,11 +147,7 @@ export function nextAdvisorPollInterval( * means only the transient 503 surface (provider chain unavailable). */ export type AdvisorFetchOutcome = - | "fresh" - | "empty" - | "rate-limited" - | "timeout" - | "no-provider"; + "fresh" | "empty" | "rate-limited" | "timeout" | "no-provider"; interface AdvisorFetchResult { payload: InsightAdvisorPayload | null; diff --git a/src/components/labs/lab-biomarker-chart.tsx b/src/components/labs/lab-biomarker-chart.tsx index d82e57c20..9ac10a989 100644 --- a/src/components/labs/lab-biomarker-chart.tsx +++ b/src/components/labs/lab-biomarker-chart.tsx @@ -188,8 +188,7 @@ export function LabBiomarkerChart({ content={(props) => { const active = props.active ?? false; const payload = props.payload as - | ReadonlyArray<{ payload?: ChartPoint }> - | undefined; + ReadonlyArray<{ payload?: ChartPoint }> | undefined; const point = payload?.[0]?.payload; if (!active || !point) { return ; diff --git a/src/components/medications/__tests__/use-medication-intake.test.ts b/src/components/medications/__tests__/use-medication-intake.test.ts index a7bf9078e..c54b4a8ba 100644 --- a/src/components/medications/__tests__/use-medication-intake.test.ts +++ b/src/components/medications/__tests__/use-medication-intake.test.ts @@ -133,8 +133,7 @@ describe("runRecordIntake — shared C1 failure toast + C2 Undo", () => { const [message, opts] = vi.mocked(toast.success).mock.calls[0]; expect(message).toBe("medications.intakeToastTaken:Mounjaro"); const action = opts?.action as - | { label: string; onClick: (e: never) => void } - | undefined; + { label: string; onClick: (e: never) => void } | undefined; expect(action?.label).toBe("medications.intakeUndo"); // Firing the action calls undoIntake with the just-created event id. diff --git a/src/components/medications/medication-table.tsx b/src/components/medications/medication-table.tsx index 7085498bc..dd97b5c5e 100644 --- a/src/components/medications/medication-table.tsx +++ b/src/components/medications/medication-table.tsx @@ -98,10 +98,7 @@ export interface TableMedication { } export type MedicationTableSortColumn = - | "name" - | "nextDue" - | "compliance" - | "stock"; + "name" | "nextDue" | "compliance" | "stock"; export interface MedicationTableSort { column: MedicationTableSortColumn; diff --git a/src/components/medications/scheduling/schedule-times-editor.tsx b/src/components/medications/scheduling/schedule-times-editor.tsx index 58f24262e..0ea7cfdf0 100644 --- a/src/components/medications/scheduling/schedule-times-editor.tsx +++ b/src/components/medications/scheduling/schedule-times-editor.tsx @@ -144,9 +144,7 @@ export function ScheduleTimesEditor({ ...(s.scheduleType ? { scheduleType: s.scheduleType as - | "SCHEDULED" - | "PRN" - | "CYCLIC", + "SCHEDULED" | "PRN" | "CYCLIC", } : {}), ...(typeof s.cyclicOnWeeks === "number" diff --git a/src/components/medications/sections/settings-section.tsx b/src/components/medications/sections/settings-section.tsx index 2253b1728..64856df27 100644 --- a/src/components/medications/sections/settings-section.tsx +++ b/src/components/medications/sections/settings-section.tsx @@ -107,9 +107,7 @@ export function GraceRow({ ...(s.scheduleType ? { scheduleType: s.scheduleType as - | "SCHEDULED" - | "PRN" - | "CYCLIC", + "SCHEDULED" | "PRN" | "CYCLIC", } : {}), ...(typeof s.cyclicOnWeeks === "number" diff --git a/src/components/settings/_info-tile.tsx b/src/components/settings/_info-tile.tsx index 8fa89f6c1..8b61224d6 100644 --- a/src/components/settings/_info-tile.tsx +++ b/src/components/settings/_info-tile.tsx @@ -25,11 +25,7 @@ import type { LucideIcon } from "lucide-react"; import { cn } from "@/lib/utils"; export type SettingsInfoTileTone = - | "info" - | "warning" - | "success" - | "primary" - | "neutral"; + "info" | "warning" | "success" | "primary" | "neutral"; const TONE_SURFACE: Record = { info: "border-info/40 bg-info/10", diff --git a/src/components/settings/account-section/account-section-utils.ts b/src/components/settings/account-section/account-section-utils.ts index 32253ddf1..d55718d83 100644 --- a/src/components/settings/account-section/account-section-utils.ts +++ b/src/components/settings/account-section/account-section-utils.ts @@ -47,8 +47,7 @@ export function resolveInitialTimezone( * provided error text (which has no key) rides `text` verbatim. */ export type StatusMessage = - | { key: string; params?: Record } - | { text: string }; + { key: string; params?: Record } | { text: string }; export function statusText( msg: StatusMessage, diff --git a/src/components/settings/integration-status-pill.tsx b/src/components/settings/integration-status-pill.tsx index 28806b036..b65c4adb9 100644 --- a/src/components/settings/integration-status-pill.tsx +++ b/src/components/settings/integration-status-pill.tsx @@ -45,11 +45,7 @@ import { cn } from "@/lib/utils"; * - disconnected → user clicked Disconnect; "Not connected" copy. */ export type IntegrationPillState = - | "connected" - | "warning" - | "error" - | "parked" - | "disconnected"; + "connected" | "warning" | "error" | "parked" | "disconnected"; interface IntegrationStatusPillProps { state: IntegrationPillState; diff --git a/src/components/settings/integrations/connections-panel.tsx b/src/components/settings/integrations/connections-panel.tsx index fbde4c956..8148e0e2b 100644 --- a/src/components/settings/integrations/connections-panel.tsx +++ b/src/components/settings/integrations/connections-panel.tsx @@ -52,8 +52,7 @@ const WITHINGS_OAUTH_ERROR_KEYS: Record = { }; type WithingsOauthOutcome = - | { kind: "connected" } - | { kind: "error"; reason: string }; + { kind: "connected" } | { kind: "error"; reason: string }; /** * The OAuth providers whose callbacks redirect back to the settings page with a diff --git a/src/components/settings/integrations/setup-guide-link.tsx b/src/components/settings/integrations/setup-guide-link.tsx index b07532125..f2fc7ce0d 100644 --- a/src/components/settings/integrations/setup-guide-link.tsx +++ b/src/components/settings/integrations/setup-guide-link.tsx @@ -23,12 +23,7 @@ import { useTranslations } from "@/lib/i18n/context"; export const INTEGRATION_DOCS_BASE = "https://docs.healthlog.dev/integrations"; export type IntegrationDocsProvider = - | "whoop" - | "withings" - | "fitbit" - | "polar" - | "oura" - | "nightscout"; + "whoop" | "withings" | "fitbit" | "polar" | "oura" | "nightscout"; export function integrationDocsHref(provider: IntegrationDocsProvider): string { return `${INTEGRATION_DOCS_BASE}/${provider}`; diff --git a/src/components/settings/integrations/shared.tsx b/src/components/settings/integrations/shared.tsx index 3213a02bf..846f3ee33 100644 --- a/src/components/settings/integrations/shared.tsx +++ b/src/components/settings/integrations/shared.tsx @@ -19,18 +19,9 @@ import { queryKeys } from "@/lib/query-keys"; // IntegrationStatusPill now owns state + last-sync presentation, and // the actionable error message is shown inline above the action row. export type IntegrationKey = - | "withings" - | "whoop" - | "fitbit" - | "moodlog" - | "polar" - | "oura"; + "withings" | "whoop" | "fitbit" | "moodlog" | "polar" | "oura"; export type IntegrationState = - | "connected" - | "error_transient" - | "error_reauth" - | "disconnected" - | "parked"; + "connected" | "error_transient" | "error_reauth" | "disconnected" | "parked"; export interface IntegrationStatusViewModel { integration: IntegrationKey; diff --git a/src/components/settings/notification-status-card.tsx b/src/components/settings/notification-status-card.tsx index 4fd04c3d9..bd3ebd9d2 100644 --- a/src/components/settings/notification-status-card.tsx +++ b/src/components/settings/notification-status-card.tsx @@ -41,10 +41,7 @@ import { apiGet, apiPost } from "@/lib/api/api-fetch"; type ChannelType = "TELEGRAM" | "NTFY" | "WEB_PUSH" | "APNS"; type ChannelState = - | "active" - | "auto_disabled" - | "manually_disabled" - | "sending_paused"; + "active" | "auto_disabled" | "manually_disabled" | "sending_paused"; interface ChannelStatus { id: string; diff --git a/src/lib/ai/coach/suggest-gate.ts b/src/lib/ai/coach/suggest-gate.ts index 6334ed2f8..cc29765d4 100644 --- a/src/lib/ai/coach/suggest-gate.ts +++ b/src/lib/ai/coach/suggest-gate.ts @@ -43,8 +43,7 @@ export type SuggestionSuppressReason = | "duplicate"; export type SuggestionDecision = - | { surface: true } - | { surface: false; reason: SuggestionSuppressReason }; + { surface: true } | { surface: false; reason: SuggestionSuppressReason }; /** * Pure pref-level decision (no DB). Applies opt-out, the explicit stop diff --git a/src/lib/ai/coach/tools/executor.ts b/src/lib/ai/coach/tools/executor.ts index 765404be4..9ac9b252a 100644 --- a/src/lib/ai/coach/tools/executor.ts +++ b/src/lib/ai/coach/tools/executor.ts @@ -337,8 +337,7 @@ async function getMedicationCompliance( const compliance = pickSection(snapshot.sections, "compliance"); // GLP-1 context rides the `weeklyContext` block. const weeklyContext = pickSection(snapshot.sections, "weeklyContext") as - | { glp1?: unknown } - | undefined; + { glp1?: unknown } | undefined; const glp1 = weeklyContext?.glp1; if (compliance === undefined && glp1 === undefined) { return { present: false, reason: "no_data" }; @@ -377,8 +376,7 @@ async function getLabs( scopeFor([], fallbackWindow, fallbackWindow, sharedScope), ); const labs = pickSection(snapshot.sections, "labs") as - | { recent?: Array<{ name?: string; analyte?: string }> } - | undefined; + { recent?: Array<{ name?: string; analyte?: string }> } | undefined; if (labs === undefined) return { present: false, reason: "no_data" }; const analyte = parsed.data.analyte?.trim().toLowerCase(); diff --git a/src/lib/ai/codex-oauth.ts b/src/lib/ai/codex-oauth.ts index 3f4f6e1b7..a8e609203 100644 --- a/src/lib/ai/codex-oauth.ts +++ b/src/lib/ai/codex-oauth.ts @@ -202,8 +202,7 @@ export async function requestDeviceCode(): Promise { } export type DevicePollResult = - | { status: "pending" } - | { status: "connected"; creds: CodexCreds }; + { status: "pending" } | { status: "connected"; creds: CodexCreds }; /** * One poll attempt against the device-auth token endpoint. Returns diff --git a/src/lib/ai/medical-references.ts b/src/lib/ai/medical-references.ts index 07b824f5b..ac160746f 100644 --- a/src/lib/ai/medical-references.ts +++ b/src/lib/ai/medical-references.ts @@ -31,11 +31,7 @@ export type MedicalReferenceOrg = "AHA" | "ESH" | "ESC" | "WHO" | "DGE" | "ADA"; export type MedicalReferenceMetric = - | "bp" - | "weight" - | "pulse" - | "mood" - | "medication"; + "bp" | "weight" | "pulse" | "mood" | "medication"; export interface MedicalReference { /** Stable slug — used as `recommendation.referenceId`. */ diff --git a/src/lib/ai/types.ts b/src/lib/ai/types.ts index 7cb27e2d7..cb33c91aa 100644 --- a/src/lib/ai/types.ts +++ b/src/lib/ai/types.ts @@ -103,11 +103,7 @@ export type InsightResult = z.infer; // ─── Provider Types ──────────────────────────────────────── export type ProviderType = - | "codex" - | "admin-key" - | "anthropic" - | "local" - | "none"; + "codex" | "admin-key" | "anthropic" | "local" | "none"; export interface AIProvider { type: ProviderType; @@ -368,20 +364,16 @@ export function singleUserTurn(p: { ? p.user : [ { type: "text", text: p.user }, - ...images.map( - (img): AiImagePart => ({ - type: "image", - mediaType: img.mediaType, - dataBase64: img.dataBase64, - }), - ), - ...documents.map( - (doc): AiDocPart => ({ - type: "document", - mediaType: doc.mediaType, - dataBase64: doc.dataBase64, - }), - ), + ...images.map((img): AiImagePart => ({ + type: "image", + mediaType: img.mediaType, + dataBase64: img.dataBase64, + })), + ...documents.map((doc): AiDocPart => ({ + type: "document", + mediaType: doc.mediaType, + dataBase64: doc.dataBase64, + })), ]; return { system: p.system, diff --git a/src/lib/analytics/compliance.ts b/src/lib/analytics/compliance.ts index 3dd7962ee..c85c11fe1 100644 --- a/src/lib/analytics/compliance.ts +++ b/src/lib/analytics/compliance.ts @@ -77,11 +77,7 @@ export interface IntakeEvent { } export type IntakeTimingClass = - | "early" - | "on_time" - | "late" - | "very_late" - | "missed"; + "early" | "on_time" | "late" | "very_late" | "missed"; export interface ComplianceResult { totalExpected: number; diff --git a/src/lib/analytics/merge-slim-thick.ts b/src/lib/analytics/merge-slim-thick.ts index d4336b3d2..b9cc72c41 100644 --- a/src/lib/analytics/merge-slim-thick.ts +++ b/src/lib/analytics/merge-slim-thick.ts @@ -54,8 +54,7 @@ export interface AnalyticsThickLike extends AnalyticsSlimLike { export interface MergedDashboardAnalytics { summaries: Record; lastSeenByType?: - | Record - | undefined; + Record | undefined; bpInTargetPct: number | null; bpInTargetPct7d: number | null; bpInTargetPct30d: number | null; @@ -98,13 +97,13 @@ export function mergeSlimAndThickAnalytics( const slimFreshnessHasContent = hasContent(slim?.lastSeenByType ?? null); const lastSeenByType: - | Record - | undefined = slimFreshnessHasContent - ? (slim!.lastSeenByType as Record< - string, - { lastSeenAt: string; daysAgo: number } | null - >) - : (thick?.lastSeenByType ?? undefined); + Record | undefined = + slimFreshnessHasContent + ? (slim!.lastSeenByType as Record< + string, + { lastSeenAt: string; daysAgo: number } | null + >) + : (thick?.lastSeenByType ?? undefined); return { summaries, diff --git a/src/lib/analytics/source-priority.ts b/src/lib/analytics/source-priority.ts index c7eac9e87..b0748610b 100644 --- a/src/lib/analytics/source-priority.ts +++ b/src/lib/analytics/source-priority.ts @@ -212,8 +212,7 @@ export function pickCanonicalSourceRows( >(); for (const row of pickedRows) { const typeKey = (row.type ?? "__default__") as - | MeasurementType - | "__default__"; + MeasurementType | "__default__"; const set = presentByType.get(typeKey) ?? new Set(); set.add(normalizeDeviceType(row.deviceType)); presentByType.set(typeKey, set); @@ -248,8 +247,7 @@ export function pickCanonicalSourceRows( for (const row of pickedRows) { const typeKey = (row.type ?? "__default__") as - | MeasurementType - | "__default__"; + MeasurementType | "__default__"; const winner = winningDeviceTypeByRowType.get(typeKey); if (winner === "__fallback__") { // Per-type fallback: keep every row of this type. diff --git a/src/lib/auth/__tests__/refresh-token.test.ts b/src/lib/auth/__tests__/refresh-token.test.ts index 51611e22a..b4eb6d4df 100644 --- a/src/lib/auth/__tests__/refresh-token.test.ts +++ b/src/lib/auth/__tests__/refresh-token.test.ts @@ -88,9 +88,7 @@ vi.mock("@/lib/db", () => ({ let count = 0; for (const row of dbState.apiTokens) { const tokenHashFilter = where.tokenHash as - | string - | { in: string[] } - | undefined; + string | { in: string[] } | undefined; const matches = !tokenHashFilter || (typeof tokenHashFilter === "string" diff --git a/src/lib/auth/mfa/webauthn.ts b/src/lib/auth/mfa/webauthn.ts index 0358321af..7b7326480 100644 --- a/src/lib/auth/mfa/webauthn.ts +++ b/src/lib/auth/mfa/webauthn.ts @@ -79,13 +79,7 @@ const authenticationResponseSchema = z .loose(); type Transport = - | "ble" - | "cable" - | "hybrid" - | "internal" - | "nfc" - | "smart-card" - | "usb"; + "ble" | "cable" | "hybrid" | "internal" | "nfc" | "smart-card" | "usb"; const CHALLENGE_TTL_MS = 5 * 60 * 1000; diff --git a/src/lib/auth/passkey.ts b/src/lib/auth/passkey.ts index 3aa980ba1..4cd89840f 100644 --- a/src/lib/auth/passkey.ts +++ b/src/lib/auth/passkey.ts @@ -73,13 +73,7 @@ const registrationResponseSchema = z .loose(); type Transport = - | "ble" - | "cable" - | "hybrid" - | "internal" - | "nfc" - | "smart-card" - | "usb"; + "ble" | "cable" | "hybrid" | "internal" | "nfc" | "smart-card" | "usb"; // The relying-party config (`rpName` / `getRpId` / `getExpectedOrigin`) is // shared with the second-factor security-key path via `@/lib/auth/webauthn-rp` diff --git a/src/lib/auth/refresh-token.ts b/src/lib/auth/refresh-token.ts index f06aeed5e..2f6b44b28 100644 --- a/src/lib/auth/refresh-token.ts +++ b/src/lib/auth/refresh-token.ts @@ -83,10 +83,7 @@ export async function issueAccessAndRefresh( } export type RotationFailureReason = - | "not_found" - | "expired" - | "already_used" - | "revoked"; + "not_found" | "expired" | "already_used" | "revoked"; export type RotationResult = | { ok: true; bundle: IssuedRefreshBundle } diff --git a/src/lib/consent/web-grant.ts b/src/lib/consent/web-grant.ts index b61cb9f66..b9d5f864d 100644 --- a/src/lib/consent/web-grant.ts +++ b/src/lib/consent/web-grant.ts @@ -29,8 +29,7 @@ import type { ConsentReceipt } from "@/lib/consent/receipts"; /** Outcome of an idempotent web-grant call. */ export type WebConsentGrantResult = - | { minted: true; receipt: ConsentReceipt } - | { minted: false }; + { minted: true; receipt: ConsentReceipt } | { minted: false }; /** * Ensure the web user has an active `ai_full` consent receipt, minting one diff --git a/src/lib/cycle/phase-crosstab.ts b/src/lib/cycle/phase-crosstab.ts index 896376fb1..30160944a 100644 --- a/src/lib/cycle/phase-crosstab.ts +++ b/src/lib/cycle/phase-crosstab.ts @@ -70,14 +70,7 @@ export const PHASE_ORDINAL: Record = { /** Display-unit hint the client formatter branches on. */ export type PhaseCrosstabDisplay = - | "hours" - | "steps" - | "bpm" - | "ms" - | "kg" - | "celsius" - | "glucose" - | "mood"; + "hours" | "steps" | "bpm" | "ms" | "kg" | "celsius" | "glucose" | "mood"; /** * Synthetic non-MeasurementType channel key for the MOOD outcome. Mood lives in diff --git a/src/lib/cycle/types.ts b/src/lib/cycle/types.ts index 29c86a7dd..16eada87f 100644 --- a/src/lib/cycle/types.ts +++ b/src/lib/cycle/types.ts @@ -22,17 +22,10 @@ export type FlowLevel = "NONE" | "SPOTTING" | "LIGHT" | "MEDIUM" | "HEAVY"; export type OvulationTest = - | "NEGATIVE" - | "POSITIVE_LH_SURGE" - | "ESTROGEN_SURGE" - | "INDETERMINATE"; + "NEGATIVE" | "POSITIVE_LH_SURGE" | "ESTROGEN_SURGE" | "INDETERMINATE"; export type CervicalMucus = - | "DRY" - | "STICKY" - | "CREAMY" - | "WATERY" - | "EGG_WHITE"; + "DRY" | "STICKY" | "CREAMY" | "WATERY" | "EGG_WHITE"; /** * Which symptothermal SECONDARY sign pairs with the temperature primary sign @@ -53,10 +46,7 @@ export type CervixOpening = "CLOSED" | "OPEN"; export type CyclePhase = "MENSTRUAL" | "FOLLICULAR" | "OVULATORY" | "LUTEAL"; export type PredictionMethod = - | "CALENDAR" - | "SYMPTOTHERMAL" - | "TEMPERATURE_TREND" - | "BLENDED"; + "CALENDAR" | "SYMPTOTHERMAL" | "TEMPERATURE_TREND" | "BLENDED"; export type CycleTrackingGoal = | "GENERAL_HEALTH" diff --git a/src/lib/fitbit/client.ts b/src/lib/fitbit/client.ts index e5eab0e07..1ca71cd70 100644 --- a/src/lib/fitbit/client.ts +++ b/src/lib/fitbit/client.ts @@ -478,12 +478,7 @@ export interface FitbitMappedMeasurement { /** HealthLog `SleepStage` values a Fitbit sleep stage maps onto. */ export type FitbitSleepStage = - | "IN_BED" - | "AWAKE" - | "ASLEEP" - | "REM" - | "CORE" - | "DEEP"; + "IN_BED" | "AWAKE" | "ASLEEP" | "REM" | "CORE" | "DEEP"; // ── Weight + body fat (/body/log/{weight,fat}) ───────────────── // diff --git a/src/lib/gamification/achievements.ts b/src/lib/gamification/achievements.ts index e61b00c1e..81c90fb41 100644 --- a/src/lib/gamification/achievements.ts +++ b/src/lib/gamification/achievements.ts @@ -53,12 +53,7 @@ export type AchievementMetricKey = * leaked to the DOM) */ export type AchievementCategory = - | "medication" - | "vitals" - | "mood" - | "security" - | "engagement" - | "hidden"; + "medication" | "vitals" | "mood" | "security" | "engagement" | "hidden"; export interface AchievementDefinition { id: string; diff --git a/src/lib/http/read-capped.ts b/src/lib/http/read-capped.ts index 9db36911a..ae28814f6 100644 --- a/src/lib/http/read-capped.ts +++ b/src/lib/http/read-capped.ts @@ -12,8 +12,7 @@ * returns the decoded UTF-8 text on success. */ export type CappedReadResult = - | { ok: true; text: string } - | { ok: false; reason: "too_large" }; + { ok: true; text: string } | { ok: false; reason: "too_large" }; export async function readBodyCapped( source: { headers: Headers; body: ReadableStream | null }, diff --git a/src/lib/idempotency.ts b/src/lib/idempotency.ts index bc6da8b94..a5edd029b 100644 --- a/src/lib/idempotency.ts +++ b/src/lib/idempotency.ts @@ -60,9 +60,7 @@ function getIdempotencyKey(request: Request | NextRequest): string | null { * - `null` — no live row; the caller may claim + run. */ type CacheLookup = - | { kind: "replay"; response: NextResponse } - | { kind: "pending" } - | null; + { kind: "replay"; response: NextResponse } | { kind: "pending" } | null; /** * Look up the state of a (userId, key, method, path) tuple. Distinguishes diff --git a/src/lib/illness/gate.ts b/src/lib/illness/gate.ts index 16195cdf3..5d59a1761 100644 --- a/src/lib/illness/gate.ts +++ b/src/lib/illness/gate.ts @@ -29,8 +29,7 @@ export function isIllnessEnabled(userId: string): Promise { * verbatim — mirrors `CycleGateResult`. */ export type IllnessGateResult = - | { enabled: true } - | { enabled: false; response: Response }; + { enabled: true } | { enabled: false; response: Response }; /** * Enforce the gate for an `/api/illness/*` route. Returns a 403 diff --git a/src/lib/insights/comprehensive-generate.ts b/src/lib/insights/comprehensive-generate.ts index 60cbca84b..5d754e993 100644 --- a/src/lib/insights/comprehensive-generate.ts +++ b/src/lib/insights/comprehensive-generate.ts @@ -409,9 +409,10 @@ export async function buildComparisonSnapshotForUser( orderBy: { measuredAt: "asc" }, select: { measuredAt: true, value: true }, }); - dataPoints = measurements.map( - (m): DataPoint => ({ date: m.measuredAt, value: m.value }), - ); + dataPoints = measurements.map((m): DataPoint => ({ + date: m.measuredAt, + value: m.value, + })); } const summary = summarize(dataPoints); const baselineAvg = diff --git a/src/lib/insights/derived/chronotype.ts b/src/lib/insights/derived/chronotype.ts index d066c75b1..7bc6fa2da 100644 --- a/src/lib/insights/derived/chronotype.ts +++ b/src/lib/insights/derived/chronotype.ts @@ -83,11 +83,7 @@ const DEFAULTS: Required = { * surface. */ export type ChronotypeBand = - | "extreme_early" - | "early" - | "intermediate" - | "late" - | "extreme_late"; + "extreme_early" | "early" | "intermediate" | "late" | "extreme_late"; /** * Band a corrected mid-sleep (MSFsc, minutes-of-day) into the MCTQ chronotype diff --git a/src/lib/insights/derived/sleep-rhythm.ts b/src/lib/insights/derived/sleep-rhythm.ts index e63ba97be..63ac5f015 100644 --- a/src/lib/insights/derived/sleep-rhythm.ts +++ b/src/lib/insights/derived/sleep-rhythm.ts @@ -112,12 +112,7 @@ export interface ChronotypeDto { msfMinutes: number | null; msfScMinutes: number | null; band: - | "extreme_early" - | "early" - | "intermediate" - | "late" - | "extreme_late" - | null; + "extreme_early" | "early" | "intermediate" | "late" | "extreme_late" | null; socialJetlagMinutes: number | null; freeNightsCounted: number; workNightsCounted: number; diff --git a/src/lib/insights/derived/types.ts b/src/lib/insights/derived/types.ts index 5d4398baf..434dd67f5 100644 --- a/src/lib/insights/derived/types.ts +++ b/src/lib/insights/derived/types.ts @@ -28,12 +28,7 @@ export type DerivedConfidenceBand = "high" | "medium" | "low" | "draft"; * = no data backed the value. */ export type DerivedProvenanceSource = - | "DAY" - | "WEEK" - | "MONTH" - | "YEAR" - | "live" - | "none"; + "DAY" | "WEEK" | "MONTH" | "YEAR" | "live" | "none"; /** * Where a derived value's inputs came from. Lets every surface show the diff --git a/src/lib/insights/features.ts b/src/lib/insights/features.ts index 76d3e0afe..06cf59322 100644 --- a/src/lib/insights/features.ts +++ b/src/lib/insights/features.ts @@ -281,13 +281,7 @@ export interface AggregatedFeatures { export interface SignalOfDay { /** Briefing `sourceMetric` discriminator the UI pins an icon + route on. */ metric: - | "bp" - | "weight" - | "pulse" - | "mood" - | "sleep" - | "resting_hr" - | "glucose"; + "bp" | "weight" | "pulse" | "mood" | "sleep" | "resting_hr" | "glucose"; /** Natural-language label (no enum leak into prose). */ label: string; /** Unit string when the metric carries one. */ diff --git a/src/lib/insights/mood-aggregates.ts b/src/lib/insights/mood-aggregates.ts index dc16fa790..5ae7ced90 100644 --- a/src/lib/insights/mood-aggregates.ts +++ b/src/lib/insights/mood-aggregates.ts @@ -1677,10 +1677,7 @@ export const STABILITY_MIN_DAYS = 7; export const STABILITY_SD_FULL_SCALE = 1.5; export type StabilityBand = - | "verySteady" - | "steady" - | "variable" - | "veryVariable"; + "verySteady" | "steady" | "variable" | "veryVariable"; export interface MoodStability { /** 0..100; higher = steadier (lower day-to-day variance). */ diff --git a/src/lib/insights/narrative/period-narrative.ts b/src/lib/insights/narrative/period-narrative.ts index 96ce3adc6..0bcb4ac47 100644 --- a/src/lib/insights/narrative/period-narrative.ts +++ b/src/lib/insights/narrative/period-narrative.ts @@ -171,8 +171,7 @@ export interface PeriodNarrativeInsufficient { } export type PeriodNarrativeResult = - | PeriodNarrativeContext - | PeriodNarrativeInsufficient; + PeriodNarrativeContext | PeriodNarrativeInsufficient; // ── pure helpers ────────────────────────────────────────────────────────── diff --git a/src/lib/integrations/http-status-classifier.ts b/src/lib/integrations/http-status-classifier.ts index fe10349c8..b7113f279 100644 --- a/src/lib/integrations/http-status-classifier.ts +++ b/src/lib/integrations/http-status-classifier.ts @@ -25,10 +25,7 @@ /** Outcome buckets shared across the HTTP-status-driven integrations. */ export type IntegrationClassification = - | "success" - | "transient" - | "reauth_required" - | "persistent"; + "success" | "transient" | "reauth_required" | "persistent"; export interface ClassifiedHttpResponse { classification: IntegrationClassification; diff --git a/src/lib/integrations/status.ts b/src/lib/integrations/status.ts index 41c3fda75..3b9188580 100644 --- a/src/lib/integrations/status.ts +++ b/src/lib/integrations/status.ts @@ -108,11 +108,7 @@ export function toFailureKind( * trail. */ export type IntegrationState = - | "connected" - | "error_transient" - | "error_reauth" - | "disconnected" - | "parked"; + "connected" | "error_transient" | "error_reauth" | "disconnected" | "parked"; /** * The ladder at which a streak of failures escalates from "user-visible diff --git a/src/lib/jobs/coach-plan-review.ts b/src/lib/jobs/coach-plan-review.ts index 045d95280..1b753f1a1 100644 --- a/src/lib/jobs/coach-plan-review.ts +++ b/src/lib/jobs/coach-plan-review.ts @@ -124,11 +124,7 @@ export function resolvePlanMetric(metric: string): ResolvedMetric | null { } export type ExperimentVerdict = - | "improved" - | "worsened" - | "no_change" - | "changed" - | "insufficient"; + "improved" | "worsened" | "no_change" | "changed" | "insufficient"; export interface ExperimentOutcomeInput { label: string; diff --git a/src/lib/jobs/cycle-reminder.ts b/src/lib/jobs/cycle-reminder.ts index 9f2673c8b..1ec6ebbb2 100644 --- a/src/lib/jobs/cycle-reminder.ts +++ b/src/lib/jobs/cycle-reminder.ts @@ -76,9 +76,7 @@ export const FERTILE_SOON_LEAD_DAYS = 2; export const PERIOD_CONFIRM_GRACE_DAYS = 3; export type CycleReminderEvent = - | "CYCLE_PERIOD_SOON" - | "CYCLE_PERIOD_CONFIRM" - | "CYCLE_FERTILE_SOON"; + "CYCLE_PERIOD_SOON" | "CYCLE_PERIOD_CONFIRM" | "CYCLE_FERTILE_SOON"; export interface CycleReminderSummary { candidatesScanned: number; diff --git a/src/lib/jobs/insight-pregenerate.ts b/src/lib/jobs/insight-pregenerate.ts index ed91ac1d3..0c8af42ea 100644 --- a/src/lib/jobs/insight-pregenerate.ts +++ b/src/lib/jobs/insight-pregenerate.ts @@ -183,11 +183,7 @@ export interface ForceWarmResult { * card warm below. */ comprehensive: - | GenerateOutcome["status"] - | "timeout" - | "fresh" - | "backoff" - | "capped"; + GenerateOutcome["status"] | "timeout" | "fresh" | "backoff" | "capped"; /** Count of specialised per-status assessments written warm. */ assessmentsWarmed: number; /** Count of generic per-HealthKit-metric assessments written warm. */ diff --git a/src/lib/labs/ocr-upload.ts b/src/lib/labs/ocr-upload.ts index e8e3bbdbe..385e292e8 100644 --- a/src/lib/labs/ocr-upload.ts +++ b/src/lib/labs/ocr-upload.ts @@ -18,10 +18,7 @@ export const OCR_MAX_BYTES = 12 * 1024 * 1024; /** The MIME types the extract route accepts (no HEIC in v1). */ export type OcrUploadMime = - | "image/jpeg" - | "image/png" - | "image/webp" - | "application/pdf"; + "image/jpeg" | "image/png" | "image/webp" | "application/pdf"; /** Thrown by `readBoundedBody` when the stream exceeds the byte cap. */ export class BodyTooLargeError extends Error { diff --git a/src/lib/mcp/oauth/clients.ts b/src/lib/mcp/oauth/clients.ts index e6060ddfb..d6d3fc0b3 100644 --- a/src/lib/mcp/oauth/clients.ts +++ b/src/lib/mcp/oauth/clients.ts @@ -53,10 +53,7 @@ export interface ResolvedClient { * `SafeFetchError.kind` + message + cause) for the `/authorize` annotation. */ export type ClientResolutionReason = - | "unknown_client" - | "invalid_metadata" - | "ssrf_blocked" - | "fetch_failed"; + "unknown_client" | "invalid_metadata" | "ssrf_blocked" | "fetch_failed"; export type ClientResolution = | { ok: true; client: ResolvedClient } diff --git a/src/lib/mcp/tools.ts b/src/lib/mcp/tools.ts index 40d81952d..cadad2cd2 100644 --- a/src/lib/mcp/tools.ts +++ b/src/lib/mcp/tools.ts @@ -140,8 +140,7 @@ function plainMetricText(rid: string, result: unknown): string { }; if (!r?.present) return `No recent ${rid} data is on file.`; const section = (r.data?.section ?? r.data) as - | Record - | undefined; + Record | undefined; const agg = section?.aggregate as Record | undefined; const parts: string[] = []; const mean = num(agg?.mean); diff --git a/src/lib/measurements/__tests__/consolidation-scan-paged.test.ts b/src/lib/measurements/__tests__/consolidation-scan-paged.test.ts index 78712a9e8..ea8bf0563 100644 --- a/src/lib/measurements/__tests__/consolidation-scan-paged.test.ts +++ b/src/lib/measurements/__tests__/consolidation-scan-paged.test.ts @@ -49,8 +49,7 @@ function buildPagingFindMany(allRows: PerSampleRow[]) { const or = (and[1] as { OR?: Array> }).OR; const gt = or?.[0]?.measuredAt as { gt?: Date } | undefined; const tie = or?.[1] as - | { measuredAt?: Date; id?: { gt?: string } } - | undefined; + { measuredAt?: Date; id?: { gt?: string } } | undefined; afterTime = gt?.gt ? gt.gt.getTime() : null; afterId = tie?.id?.gt ?? null; } diff --git a/src/lib/measurements/apple-health-mapping.ts b/src/lib/measurements/apple-health-mapping.ts index 39db69181..686e3e254 100644 --- a/src/lib/measurements/apple-health-mapping.ts +++ b/src/lib/measurements/apple-health-mapping.ts @@ -38,11 +38,7 @@ import type { * in the pipeline once we observe the production sample volume. */ export type AppleHealthAggregation = - | "sum" - | "mean" - | "latest" - | "max" - | "median"; + "sum" | "mean" | "latest" | "max" | "median"; export interface AppleHealthMapping { /** HealthKit identifier (e.g. `HKQuantityTypeIdentifierBodyMass`). */ diff --git a/src/lib/measurements/consolidation-base.ts b/src/lib/measurements/consolidation-base.ts index b643eb7af..8142a251b 100644 --- a/src/lib/measurements/consolidation-base.ts +++ b/src/lib/measurements/consolidation-base.ts @@ -128,8 +128,7 @@ export function bucketRowsByDay( /** Outcome of writing a single per-day bucket. */ export type DayWriteOutcome = - | { kind: "written"; sourceRowsRemoved: number } - | { kind: "skipped-conflict" }; + { kind: "written"; sourceRowsRemoved: number } | { kind: "skipped-conflict" }; /** * Context a per-day write strategy receives. The strategy owns its own diff --git a/src/lib/measurements/import-apple-health-export.ts b/src/lib/measurements/import-apple-health-export.ts index 699ddc1e5..c1c508f17 100644 --- a/src/lib/measurements/import-apple-health-export.ts +++ b/src/lib/measurements/import-apple-health-export.ts @@ -69,12 +69,7 @@ const SLEEP_STAGE_NAME_TO_CODEPOINT: Record = { /** Phase the worker is currently in. */ export type ImportJobPhase = - | "queued" - | "unpacking" - | "parsing" - | "upserting" - | "done" - | "failed"; + "queued" | "unpacking" | "parsing" | "upserting" | "done" | "failed"; /** * Live snapshot the worker writes to `ImportJob.progress` every diff --git a/src/lib/medications/glp1-knowledge.ts b/src/lib/medications/glp1-knowledge.ts index 08276cd42..00370537b 100644 --- a/src/lib/medications/glp1-knowledge.ts +++ b/src/lib/medications/glp1-knowledge.ts @@ -33,11 +33,7 @@ * UI looks up by id, not by brand name. */ export type Glp1DrugId = - | "tirzepatide" - | "semaglutide" - | "liraglutide" - | "dulaglutide" - | "exenatide"; + "tirzepatide" | "semaglutide" | "liraglutide" | "dulaglutide" | "exenatide"; /** * Route enum — most agonists are subcutaneous; Rybelsus is oral diff --git a/src/lib/medications/scheduling/dose-history.ts b/src/lib/medications/scheduling/dose-history.ts index c0688c767..0acfcbec8 100644 --- a/src/lib/medications/scheduling/dose-history.ts +++ b/src/lib/medications/scheduling/dose-history.ts @@ -67,12 +67,7 @@ export interface HistoryIntake { } export type DoseHistoryStatus = - | "taken_on_time" - | "taken_late" - | "skipped" - | "missed" - | "upcoming" - | "ad_hoc"; + "taken_on_time" | "taken_late" | "skipped" | "missed" | "upcoming" | "ad_hoc"; /** * v1.15.20 — the due-context an ad-hoc row carries: the nearest scheduled diff --git a/src/lib/medications/side-effects/taxonomy.ts b/src/lib/medications/side-effects/taxonomy.ts index 9c0d75e7f..be79f39f5 100644 --- a/src/lib/medications/side-effects/taxonomy.ts +++ b/src/lib/medications/side-effects/taxonomy.ts @@ -135,11 +135,7 @@ export type SideEffectSeverity = 1 | 2 | 3 | 4 | 5; /** Locale-agnostic semantic labels for the severity ladder. */ export type SideEffectSeverityLabel = - | "mild" - | "moderate" - | "significant" - | "severe" - | "verySevere"; + "mild" | "moderate" | "significant" | "severe" | "verySevere"; /** * Maps a 1-5 severity integer to its locale-agnostic semantic label. diff --git a/src/lib/modules/gate.ts b/src/lib/modules/gate.ts index c568356a5..ff32f383a 100644 --- a/src/lib/modules/gate.ts +++ b/src/lib/modules/gate.ts @@ -240,8 +240,7 @@ export async function resolveModuleMap( * return verbatim — mirrors `CycleGateResult`. */ export type ModuleGateResult = - | { enabled: true } - | { enabled: false; response: Response }; + { enabled: true } | { enabled: false; response: Response }; /** * Enforce the gate for a module-scoped route. Returns a 403 diff --git a/src/lib/mood/icon-catalog.ts b/src/lib/mood/icon-catalog.ts index bcb2b1c3b..3c5324641 100644 --- a/src/lib/mood/icon-catalog.ts +++ b/src/lib/mood/icon-catalog.ts @@ -22,13 +22,7 @@ */ export type MoodTagIconGroup = - | "emotions" - | "activities" - | "health" - | "food" - | "weather" - | "places" - | "misc"; + "emotions" | "activities" | "health" | "food" | "weather" | "places" | "misc"; export interface MoodTagIconCatalogEntry { /** Lucide icon name — the value stored on `mood_tags.icon` / `mood_tag_categories.icon`. */ diff --git a/src/lib/polar/client.ts b/src/lib/polar/client.ts index 3b20ab991..2b0ce7977 100644 --- a/src/lib/polar/client.ts +++ b/src/lib/polar/client.ts @@ -267,9 +267,7 @@ async function fetchCollection( // 204 No Content — a window with no records. Polar returns an empty body. if (res.status === 204) return []; const json = (await res.json().catch(() => null)) as - | CollectionResult - | Record - | null; + CollectionResult | Record | null; if (!json) return []; const list = (json as Record)[recordsKey]; return Array.isArray(list) ? (list as T[]) : []; diff --git a/src/lib/reference-ranges.ts b/src/lib/reference-ranges.ts index 01a124823..54fa1ff67 100644 --- a/src/lib/reference-ranges.ts +++ b/src/lib/reference-ranges.ts @@ -458,10 +458,7 @@ export function referenceLabel(metric: ReferenceMetric): string { * (device-derived / baseline-only signals). */ export type ReferencePlacement = - | "within" - | "slightly-outside" - | "outside" - | "insufficient"; + "within" | "slightly-outside" | "outside" | "insufficient"; /** * Place a value against a metric's population bands. Returns diff --git a/src/lib/sync/cursor.ts b/src/lib/sync/cursor.ts index bb260f71f..ebc28d14e 100644 --- a/src/lib/sync/cursor.ts +++ b/src/lib/sync/cursor.ts @@ -28,11 +28,7 @@ /** The sync domains the feed serves. */ export type SyncDomain = - | "measurements" - | "mood" - | "intakes" - | "cycleDays" - | "cycles"; + "measurements" | "mood" | "intakes" | "cycleDays" | "cycles"; export const SYNC_DOMAINS: readonly SyncDomain[] = [ "measurements", diff --git a/src/lib/targets/glucose-targets.ts b/src/lib/targets/glucose-targets.ts index a52b6dfaa..4653c1e7b 100644 --- a/src/lib/targets/glucose-targets.ts +++ b/src/lib/targets/glucose-targets.ts @@ -43,10 +43,7 @@ import type { TrafficRange } from "@/lib/analytics/value-bands"; import { thresholdMetricForContext } from "@/lib/glucose"; export type GlucoseContextKey = - | "FASTING" - | "POSTPRANDIAL" - | "RANDOM" - | "BEDTIME"; + "FASTING" | "POSTPRANDIAL" | "RANDOM" | "BEDTIME"; /** * ADA glycemic GOAL bands for people living with diabetes (mg/dL). diff --git a/src/lib/tz/format.ts b/src/lib/tz/format.ts index b6a94cf54..afa740d0e 100644 --- a/src/lib/tz/format.ts +++ b/src/lib/tz/format.ts @@ -136,10 +136,7 @@ export function isNearUtc(tz: string, now: Date = new Date()): boolean { } export type FormatInUserTzShape = - | "iso-with-offset" - | "wall-clock" - | "datetime" - | "date"; + "iso-with-offset" | "wall-clock" | "datetime" | "date"; /** * Format an instant in the user's timezone. diff --git a/src/lib/validations/inbound-documents.ts b/src/lib/validations/inbound-documents.ts index ac29fa3db..5fc266099 100644 --- a/src/lib/validations/inbound-documents.ts +++ b/src/lib/validations/inbound-documents.ts @@ -164,9 +164,7 @@ export interface MedicationStatementFactData { } export type FactData = - | ConditionFactData - | ObservationFactData - | MedicationStatementFactData; + ConditionFactData | ObservationFactData | MedicationStatementFactData; /** The staged-fact DTO the routes return + the review UI consumes. */ export interface ExtractedFactDto { diff --git a/src/lib/withings/response-classifier.ts b/src/lib/withings/response-classifier.ts index 4836dfdb2..448d48047 100644 --- a/src/lib/withings/response-classifier.ts +++ b/src/lib/withings/response-classifier.ts @@ -53,10 +53,7 @@ /** Outcome buckets for a Withings response. */ export type WithingsClassification = - | "success" - | "transient" - | "reauth_required" - | "persistent"; + "success" | "transient" | "reauth_required" | "persistent"; export interface ClassifiedResponse { classification: WithingsClassification; diff --git a/tests/integration/analytics-bp-aggregate-paged.test.ts b/tests/integration/analytics-bp-aggregate-paged.test.ts index 9df662243..553f223b4 100644 --- a/tests/integration/analytics-bp-aggregate-paged.test.ts +++ b/tests/integration/analytics-bp-aggregate-paged.test.ts @@ -165,8 +165,7 @@ describe("GET /api/analytics — chunked per-type reads (Sr-H1)", () => { // which writes the row-count slot under `slim_summaries` rather than // the old `bp_aggregate.row_count`. const analytics = httpEvent!.meta!.analytics as - | { slim_summaries?: { row_count?: number } } - | undefined; + { slim_summaries?: { row_count?: number } } | undefined; expect(analytics?.slim_summaries?.row_count).toBe(ROW_COUNT); }); });