From 1997a49e3de67a4bbe8e18d8c058bb7a86b5efdd Mon Sep 17 00:00:00 2001 From: Maurice Date: Mon, 30 Nov 2026 00:33:35 +0000 Subject: [PATCH] chore(places): export only what other files use The media targets, the rating label, the rating score constants, the rating match and the copy editor types are read inside their own files only, which lint:knip holds. --- client/src/components/Collections/ratingLabel.ts | 2 +- client/src/components/Collections/usePlaceMedia.ts | 2 +- server/src/db/repositories/PlacesLibrary.repository.ts | 6 +++--- server/src/nest/common/place-copies.port.ts | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/client/src/components/Collections/ratingLabel.ts b/client/src/components/Collections/ratingLabel.ts index c0d508b06..203821a51 100644 --- a/client/src/components/Collections/ratingLabel.ts +++ b/client/src/components/Collections/ratingLabel.ts @@ -1,5 +1,5 @@ /** A vote average as the badge on a place's picture shows it: whole stars bare, the rest to one place. */ -export const ratingLabel = (rating: number): string => (Number.isInteger(rating) ? String(rating) : rating.toFixed(1)); +const ratingLabel = (rating: number): string => (Number.isInteger(rating) ? String(rating) : rating.toFixed(1)); /** The badge text of an average, or null when there is no vote to show. */ export function ratingBadge(average: number | null | undefined): string | null { diff --git a/client/src/components/Collections/usePlaceMedia.ts b/client/src/components/Collections/usePlaceMedia.ts index 4e2524751..f6b33e0ac 100644 --- a/client/src/components/Collections/usePlaceMedia.ts +++ b/client/src/components/Collections/usePlaceMedia.ts @@ -17,7 +17,7 @@ export interface MediaTarget { } /** Every trip and list of the place that takes an upload from the reader: trips first, they keep any file. */ -export function mediaTargets(entry: PlacesLibraryEntry | null): MediaTarget[] { +function mediaTargets(entry: PlacesLibraryEntry | null): MediaTarget[] { const origins = entry?.origins ?? []; const out: MediaTarget[] = []; for (const o of origins) diff --git a/server/src/db/repositories/PlacesLibrary.repository.ts b/server/src/db/repositories/PlacesLibrary.repository.ts index f17f309c8..d35cbb90d 100644 --- a/server/src/db/repositories/PlacesLibrary.repository.ts +++ b/server/src/db/repositories/PlacesLibrary.repository.ts @@ -48,10 +48,10 @@ const NO_MATCH: LibraryMatch = { search: null, categoryId: null, status: null, t * a cursor read the same on both engines; ties a millionth of a star apart * fall back to the key. */ -export const RATING_SCORE_SCALE = 1_000_000; +const RATING_SCORE_SCALE = 1_000_000; /** The sort value of an entry nobody voted on: below every average, so it comes last. */ -export const UNRATED_SCORE = -1; +const UNRATED_SCORE = -1; /** * The road trip stops that belong to the drive rather than to the places of @@ -105,7 +105,7 @@ export interface LibraryMatch { * rating counts them. `min` keeps the entries whose average is at least that * many stars (an entry without votes has none); null keeps every entry. */ -export interface LibraryRatingMatch { +interface LibraryRatingMatch { min: number | null; reach: LibraryArms; } diff --git a/server/src/nest/common/place-copies.port.ts b/server/src/nest/common/place-copies.port.ts index a982b7bc0..f65e2aa11 100644 --- a/server/src/nest/common/place-copies.port.ts +++ b/server/src/nest/common/place-copies.port.ts @@ -11,7 +11,7 @@ */ /** Who edits, as the permission checks read them. */ -export interface CopyEditor { +interface CopyEditor { id: number; role: string; }