Merged in chore/cleanup-unused (pull request #3461)

chore: Cleanup unused vars, exports, types

* Cleanup some unused exports

* Remove more

* Readd CampaignPageIncludedHotelsRef

* Add alias comment to procedure exports

* Remove unused exports


Approved-by: Linus Flood
This commit is contained in:
Anton Gunnarsson
2026-01-22 12:34:07 +00:00
parent 4de24e9f2a
commit f79ff9b570
56 changed files with 84 additions and 411 deletions

View File

@@ -2,7 +2,7 @@ import { dt } from "@scandic-hotels/common/dt"
import type { IntlShape } from "react-intl"
export const DAYS_UNTIL_EXPIRY_WARNING = 30
const DAYS_UNTIL_EXPIRY_WARNING = 30
/**
* Get expiry label for points based on the expiry date.

View File

@@ -11,7 +11,6 @@ export enum NodeNames {
table = "table",
tbody = "tbody",
td = "td",
text = "text",
th = "th",
tr = "tr",
ul = "ul",

View File

@@ -5,7 +5,7 @@ import FooterNavigation from "./Navigation"
import styles from "./footer.module.css"
export function preload() {
function preload() {
void getFooter()
}

View File

@@ -7,11 +7,10 @@ import styles from "./topLink.module.css"
import type { Header } from "@scandic-hotels/trpc/types/header"
import type { ComponentProps } from "react"
export interface TopLinkProps
extends Omit<
ComponentProps<typeof HeaderLink>,
"href" | "iconName" | "children"
> {
interface TopLinkProps extends Omit<
ComponentProps<typeof HeaderLink>,
"href" | "iconName" | "children"
> {
isLoggedIn: boolean
topLink: Header["header"]["topLink"]
iconSize?: number

View File

@@ -7,7 +7,6 @@ export {
ACCESS_GRANTED,
accessBooking as default,
ERROR_BAD_REQUEST,
ERROR_FORBIDDEN,
ERROR_NOT_FOUND,
ERROR_UNAUTHORIZED,
}
@@ -66,11 +65,6 @@ const ERROR_UNAUTHORIZED = {
status: 401,
} as const
const ERROR_FORBIDDEN = {
code: "FORBIDDEN",
status: 403,
} as const
const ERROR_NOT_FOUND = {
code: "NOT_FOUND",
status: 404,

View File

@@ -96,7 +96,6 @@ Located at `utils/profilingConsent.ts`:
- `storageKey(memberKey)` — Generate storage key
- `readDismissed(memberKey)` — Check if modal was dismissed
- `setDismissed(memberKey)` — Mark modal as dismissed
- `clearDismissed(memberKey)` — Clear dismissal flag
- `profilingConsentOpenEvent` — CustomEvent name for opening modal
- `requestOpen()` — Dispatch event to open modal

View File

@@ -7,7 +7,7 @@ const myPages = {
sv: "/sv/webview/scandic-friends/mina-sidor",
}
export const overview = {
const overview = {
da: `${myPages.da}/oversigt`,
de: `${myPages.de}/uberblick`,
en: `${myPages.en}/overview`,

View File

@@ -38,15 +38,6 @@ export const partners: LangRoute = {
sv: `/${Lang.sv}/scandic-friends/partners`,
}
export const spendPoints: LangRoute = {
da: `/${Lang.da}/scandic-friends/brug-point`,
de: `/${Lang.de}/scandic-friends/ausgeben`,
en: `/${Lang.en}/scandic-friends/spend-points`,
fi: `/${Lang.fi}/scandic-friends/hyodynna`,
no: `/${Lang.no}/scandic-friends/bruk-poeng`,
sv: `/${Lang.sv}/scandic-friends/anvand-poang`,
}
export const offers: LangRoute = {
da: `/${Lang.da}/tilbud`,
de: `/${Lang.de}/angebote`,

View File

@@ -152,7 +152,7 @@ function filterPoints(ancillaries: Ancillaries, user: User | null) {
})
}
export function generateUniqueAncillaries(
function generateUniqueAncillaries(
ancillaries: Ancillaries
): Ancillary["ancillaryContent"] {
const uniqueAncillaries = new Map(

View File

@@ -7,7 +7,7 @@ import { logger } from "@scandic-hotels/common/logger"
const logged: Record<string, boolean> = {}
export type ClientIntlProviderProps = React.PropsWithChildren<
type ClientIntlProviderProps = React.PropsWithChildren<
Pick<IntlConfig, "defaultLocale" | "messages"> & { locale: Lang }
>

View File

@@ -20,7 +20,7 @@ type FailedWarmup = {
export type WarmupResult = BaseWarmup | FailedWarmup
export const warmupFunctions: Record<WarmupFunctionsKey, WarmupFunction> = {
const warmupFunctions: Record<WarmupFunctionsKey, WarmupFunction> = {
countries_en: warmupCountry(Lang.en),
countries_da: warmupCountry(Lang.da),
countries_de: warmupCountry(Lang.de),

View File

@@ -5,7 +5,7 @@ const langs = Object.keys(Lang) as Lang[]
/*
* Keys for warmup functions, the order of the keys is the order in which they will be executed
*/
export const warmupKeys = [
const warmupKeys = [
...langs.map((lang) => `countries_${lang}` as const),
"hotelsByCountry",
...langs.map((lang) => `hotelData_${lang}` as const),

View File

@@ -1,6 +1,6 @@
import { create } from "zustand"
export type SelectedMarker = {
type SelectedMarker = {
cityId: string
location: { lat: number; lng: number }
} | null

View File

@@ -30,7 +30,6 @@ export interface CityMarker {
}
export type CityMarkerProperties = Omit<CityMarker, "coordinates">
export type CitiesClusterMarkerProperties = CityMarkerProperties[]
export type CityMarkerGeojson = FeatureCollection<Point, CityMarkerProperties>
export type CityMarkerFeature = CityMarkerGeojson["features"][number]

View File

@@ -6,7 +6,3 @@ export type MembershipLevelIconProps = {
level: MembershipLevel
rows?: 1 | 2
} & LevelProps
export type CopyButtonProps = {
membershipNumber: string
}

View File

@@ -66,9 +66,3 @@ export interface StepsProps {
savedCreditCards: CreditCard[] | null
error: AncillaryErrorMessage | null
}
export interface ActionButtonsProps {
isPriceDetailsOpen: boolean
togglePriceDetails: () => void
isSubmitting: boolean
}

View File

@@ -1,8 +1,3 @@
import type { userQueryRouter } from "@scandic-hotels/trpc/routers/user/query"
import type { User } from "@scandic-hotels/trpc/types/user"
export type UserQueryRouter = typeof userQueryRouter
export interface UserProps {
user: User
}

View File

@@ -1,34 +1,5 @@
import type { Lang } from "@scandic-hotels/common/constants/language"
import type { PageContentTypeEnum } from "@scandic-hotels/trpc/enums/contentType"
export type NextSearchParams = { [key: string]: string | string[] | undefined }
export type SearchParams<S = object> = {
searchParams: Promise<S & { [key: string]: string }>
}
export type LangParams = {
lang: Lang
}
export type StatusParams = {
status: number
}
export type ContentTypeParams = {
contentType:
| PageContentTypeEnum.loyaltyPage
| PageContentTypeEnum.campaignOverviewPage
| PageContentTypeEnum.campaignPage
| PageContentTypeEnum.contentPage
| PageContentTypeEnum.hotelPage
| PageContentTypeEnum.collectionPage
| PageContentTypeEnum.destinationOverviewPage
| PageContentTypeEnum.destinationCountryPage
| PageContentTypeEnum.destinationCityPage
| PageContentTypeEnum.startPage
}
export type UIDParams = {
uid: string
}

View File

@@ -1,7 +1,7 @@
import type { Lang } from "@scandic-hotels/common/constants/language"
import type { SyncResult } from "contentstack"
export type ChangeFrequency =
type ChangeFrequency =
| "always"
| "hourly"
| "daily"
@@ -10,7 +10,7 @@ export type ChangeFrequency =
| "yearly"
| "never"
export interface SitemapEntry {
interface SitemapEntry {
url: string
lastModified: string
changeFrequency: ChangeFrequency
@@ -62,8 +62,3 @@ export interface SyncItem {
export interface SyncResponse extends Omit<SyncResult, "items"> {
items: SyncItem[]
}
export type SyncItemsByUid = {
mainEntry: SyncItem
alternates: SyncItem[]
}

View File

@@ -1,6 +1,6 @@
export const profilingConsentOpenEvent = "profiling-consent:open"
export const storageKey = (memberKey: string) =>
const storageKey = (memberKey: string) =>
`profiling-consent:dismissed:${memberKey}`
export function readDismissed(memberKey: string): boolean {
@@ -13,11 +13,6 @@ export function setDismissed(memberKey: string): void {
localStorage.setItem(storageKey(memberKey), "1")
}
export function clearDismissed(memberKey: string): void {
if (!memberKey || typeof window === "undefined") return
localStorage.removeItem(storageKey(memberKey))
}
export function requestOpen(): void {
if (typeof window === "undefined") return
window.dispatchEvent(new CustomEvent(profilingConsentOpenEvent))

View File

@@ -64,7 +64,7 @@ export async function getLastUpdated() {
return await store().get(lastUpdatedKey)
}
export async function getSitemapData() {
async function getSitemapData() {
const sitemapData: SitemapData | null = await store().get(sitemapDataKey, {
type: "json",
})

View File

@@ -11,7 +11,4 @@ export {
trackSocialMediaClick,
} from "@scandic-hotels/tracking/navigation"
export { trackPageViewStart } from "@scandic-hotels/tracking/pageview"
export {
trackPaymentEvent,
trackUpdatePaymentMethod,
} from "@scandic-hotels/tracking/payment"
export { trackUpdatePaymentMethod } from "@scandic-hotels/tracking/payment"

View File

@@ -6,7 +6,7 @@ import { webviews } from "@/constants/routes/webviews"
import type { Lang } from "@scandic-hotels/common/constants/language"
export async function webviewSearchParams() {
async function webviewSearchParams() {
const searchParams = new URLSearchParams()
const headersList = await headers()
const loginType = headersList.get("loginType")