diff --git a/.eslintrc.json b/.eslintrc.json index 630a0576f..28938b43a 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,6 +1,13 @@ { - "extends": ["next/core-web-vitals", "plugin:import/recommended"], - "plugins": ["simple-import-sort"], + "extends": [ + "next/core-web-vitals", + "plugin:import/recommended" + ], + "plugins": [ + "simple-import-sort", + "@typescript-eslint" + ], + "parser": "@typescript-eslint/parser", "rules": { "react/function-component-definition": "error", "simple-import-sort/imports": [ @@ -8,13 +15,21 @@ { "groups": [ // Side effect imports. - ["^\\u0000"], + [ + "^\\u0000" + ], // Node.js builtins. - ["^node:"], + [ + "^node:" + ], // NPM packages. - ["^@?\\w"], + [ + "^@?\\w" + ], // Internal packages. - ["^@scandic-hotels/(?!.*\u0000$).*$"], + [ + "^@scandic-hotels/(?!.*\u0000$).*$" + ], // Local imports (lib, constants, etc.), excl. types. [ "^@/constants/?(?!.*\u0000$).*$", @@ -24,7 +39,9 @@ "^@/stores/?(?!.*\u0000$).*$" ], // Local imports (the rest), excl. types. - ["^@/(?!(types|.*\u0000$)).*$"], + [ + "^@/(?!(types|.*\u0000$)).*$" + ], // Parent imports. Put `..` last. // Other relative imports. Put same-folder imports and `.` last. [ @@ -35,9 +52,14 @@ "^\\./?$" ], // Style imports. - ["^(?!\\u0000).+\\.s?css$"], + [ + "^(?!\\u0000).+\\.s?css$" + ], // Node.js builtins and NPM packages type imports. - ["^node:.*\\u0000$", "^@?\\w.*\\u0000$"], + [ + "^node:.*\\u0000$", + "^@?\\w.*\\u0000$" + ], // Local type imports. [ "^@scandichotels/.*\\u0000$", @@ -52,6 +74,12 @@ "simple-import-sort/exports": "error", "import/first": "error", "import/newline-after-import": "error", - "import/no-duplicates": "error" + "import/no-duplicates": [ + "error", + { + "prefer-inline": true + } + ], + "@typescript-eslint/consistent-type-imports": "error" } } diff --git a/app/[lang]/(live)/(protected)/logout/route.ts b/app/[lang]/(live)/(protected)/logout/route.ts index db32e1c48..c6f7f809f 100644 --- a/app/[lang]/(live)/(protected)/logout/route.ts +++ b/app/[lang]/(live)/(protected)/logout/route.ts @@ -1,4 +1,4 @@ -import { NextRequest, NextResponse } from "next/server" +import { type NextRequest, NextResponse } from "next/server" import { AuthError } from "next-auth" import { Lang } from "@/constants/languages" diff --git a/app/[lang]/(live)/(protected)/my-pages/@breadcrumbs/[...path]/page.tsx b/app/[lang]/(live)/(protected)/my-pages/@breadcrumbs/[...path]/page.tsx index 048cf9e5f..dde4eb4b7 100644 --- a/app/[lang]/(live)/(protected)/my-pages/@breadcrumbs/[...path]/page.tsx +++ b/app/[lang]/(live)/(protected)/my-pages/@breadcrumbs/[...path]/page.tsx @@ -4,7 +4,7 @@ import Breadcrumbs from "@/components/Breadcrumbs" import BreadcrumbsSkeleton from "@/components/TempDesignSystem/Breadcrumbs/BreadcrumbsSkeleton" import { setLang } from "@/i18n/serverContext" -import { LangParams, PageArgs } from "@/types/params" +import type { LangParams, PageArgs } from "@/types/params" export default function AllBreadcrumbs({ params }: PageArgs) { setLang(params.lang) diff --git a/app/[lang]/(live)/(protected)/my-pages/profile/@communication/page.tsx b/app/[lang]/(live)/(protected)/my-pages/profile/@communication/page.tsx index 4341b3ed0..767c27815 100644 --- a/app/[lang]/(live)/(protected)/my-pages/profile/@communication/page.tsx +++ b/app/[lang]/(live)/(protected)/my-pages/profile/@communication/page.tsx @@ -6,7 +6,7 @@ import { setLang } from "@/i18n/serverContext" import styles from "./page.module.css" -import { LangParams, PageArgs } from "@/types/params" +import type { LangParams, PageArgs } from "@/types/params" export default async function CommunicationSlot({ params, diff --git a/app/[lang]/(live)/(protected)/my-pages/profile/@creditCards/page.tsx b/app/[lang]/(live)/(protected)/my-pages/profile/@creditCards/page.tsx index ea54e71fd..84ade3e0e 100644 --- a/app/[lang]/(live)/(protected)/my-pages/profile/@creditCards/page.tsx +++ b/app/[lang]/(live)/(protected)/my-pages/profile/@creditCards/page.tsx @@ -9,7 +9,7 @@ import { setLang } from "@/i18n/serverContext" import styles from "./page.module.css" -import { LangParams, PageArgs } from "@/types/params" +import type { LangParams, PageArgs } from "@/types/params" export default async function CreditCardSlot({ params }: PageArgs) { setLang(params.lang) diff --git a/app/[lang]/(live)/(protected)/my-pages/profile/@membershipCards/page.tsx b/app/[lang]/(live)/(protected)/my-pages/profile/@membershipCards/page.tsx index 913cde993..050da40f8 100644 --- a/app/[lang]/(live)/(protected)/my-pages/profile/@membershipCards/page.tsx +++ b/app/[lang]/(live)/(protected)/my-pages/profile/@membershipCards/page.tsx @@ -9,7 +9,7 @@ import { setLang } from "@/i18n/serverContext" import styles from "./page.module.css" -import { LangParams, PageArgs } from "@/types/params" +import type { LangParams, PageArgs } from "@/types/params" export default async function MembershipCardSlot({ params, diff --git a/app/[lang]/(live)/(protected)/my-pages/profile/@profile/edit/page.tsx b/app/[lang]/(live)/(protected)/my-pages/profile/@profile/edit/page.tsx index d4cee27f1..2e2386b9d 100644 --- a/app/[lang]/(live)/(protected)/my-pages/profile/@profile/edit/page.tsx +++ b/app/[lang]/(live)/(protected)/my-pages/profile/@profile/edit/page.tsx @@ -3,7 +3,7 @@ import { getProfile } from "@/lib/trpc/memoizedRequests" import Form from "@/components/Forms/Edit/Profile" import { setLang } from "@/i18n/serverContext" -import { LangParams, PageArgs } from "@/types/params" +import type { LangParams, PageArgs } from "@/types/params" export default async function EditProfileSlot({ params, diff --git a/app/[lang]/(live)/(protected)/my-pages/profile/@profile/page.tsx b/app/[lang]/(live)/(protected)/my-pages/profile/@profile/page.tsx index c12b61810..720306478 100644 --- a/app/[lang]/(live)/(protected)/my-pages/profile/@profile/page.tsx +++ b/app/[lang]/(live)/(protected)/my-pages/profile/@profile/page.tsx @@ -20,7 +20,7 @@ import { setLang } from "@/i18n/serverContext" import styles from "./page.module.css" -import { LangParams, PageArgs } from "@/types/params" +import type { LangParams, PageArgs } from "@/types/params" export default async function Profile({ params }: PageArgs) { setLang(params.lang) diff --git a/app/[lang]/(live)/(protected)/my-pages/profile/page.tsx b/app/[lang]/(live)/(protected)/my-pages/profile/page.tsx index 749065fc5..33c1ceb0c 100644 --- a/app/[lang]/(live)/(protected)/my-pages/profile/page.tsx +++ b/app/[lang]/(live)/(protected)/my-pages/profile/page.tsx @@ -5,7 +5,7 @@ import { serverClient } from "@/lib/trpc/server" import TrackingSDK from "@/components/TrackingSDK" import { setLang } from "@/i18n/serverContext" -import { LangParams, PageArgs } from "@/types/params" +import type { LangParams, PageArgs } from "@/types/params" export { generateMetadata } from "@/utils/generateMetadata" diff --git a/app/[lang]/(live)/(public)/[contentType]/[uid]/@breadcrumbs/page.tsx b/app/[lang]/(live)/(public)/[contentType]/[uid]/@breadcrumbs/page.tsx index f8024a816..587268de3 100644 --- a/app/[lang]/(live)/(public)/[contentType]/[uid]/@breadcrumbs/page.tsx +++ b/app/[lang]/(live)/(public)/[contentType]/[uid]/@breadcrumbs/page.tsx @@ -4,7 +4,7 @@ import Breadcrumbs from "@/components/Breadcrumbs" import BreadcrumbsSkeleton from "@/components/TempDesignSystem/Breadcrumbs/BreadcrumbsSkeleton" import { setLang } from "@/i18n/serverContext" -import { LangParams, PageArgs } from "@/types/params" +import type { LangParams, PageArgs } from "@/types/params" export default function PageBreadcrumbs({ params }: PageArgs) { setLang(params.lang) diff --git a/app/[lang]/(live)/(public)/[contentType]/[uid]/@preview/page.tsx b/app/[lang]/(live)/(public)/[contentType]/[uid]/@preview/page.tsx index 6a29974b3..3c6e14e9e 100644 --- a/app/[lang]/(live)/(public)/[contentType]/[uid]/@preview/page.tsx +++ b/app/[lang]/(live)/(public)/[contentType]/[uid]/@preview/page.tsx @@ -2,7 +2,7 @@ import { setPreviewData } from "@/lib/previewContext" import InitLivePreview from "@/components/LivePreview" -import { PageArgs, UIDParams } from "@/types/params" +import type { PageArgs, UIDParams } from "@/types/params" export default function PreviewPage({ searchParams, diff --git a/app/[lang]/(live)/(public)/[contentType]/[uid]/layout.tsx b/app/[lang]/(live)/(public)/[contentType]/[uid]/layout.tsx index 8ffc3c82d..afe86aa0d 100644 --- a/app/[lang]/(live)/(public)/[contentType]/[uid]/layout.tsx +++ b/app/[lang]/(live)/(public)/[contentType]/[uid]/layout.tsx @@ -1,6 +1,6 @@ import styles from "./layout.module.css" -import { +import type { ContentTypeParams, LangParams, LayoutArgs, diff --git a/app/[lang]/(live)/(public)/[contentType]/[uid]/page.tsx b/app/[lang]/(live)/(public)/[contentType]/[uid]/page.tsx index f81aa2edf..31fcd6add 100644 --- a/app/[lang]/(live)/(public)/[contentType]/[uid]/page.tsx +++ b/app/[lang]/(live)/(public)/[contentType]/[uid]/page.tsx @@ -11,7 +11,7 @@ import CollectionPage from "@/components/ContentType/StaticPages/CollectionPage" import ContentPage from "@/components/ContentType/StaticPages/ContentPage" import { setLang } from "@/i18n/serverContext" -import { +import type { ContentTypeParams, LangParams, PageArgs, diff --git a/app/[lang]/(live)/(public)/hotelreservation/(payment-callback)/payment-callback/layout.tsx b/app/[lang]/(live)/(public)/hotelreservation/(payment-callback)/payment-callback/layout.tsx index 056db9936..e0ce4da7c 100644 --- a/app/[lang]/(live)/(public)/hotelreservation/(payment-callback)/payment-callback/layout.tsx +++ b/app/[lang]/(live)/(public)/hotelreservation/(payment-callback)/payment-callback/layout.tsx @@ -1,6 +1,6 @@ import styles from "./layout.module.css" -import { LangParams, LayoutArgs } from "@/types/params" +import type { LangParams, LayoutArgs } from "@/types/params" export default function PaymentCallbackLayout({ children, diff --git a/app/[lang]/(live)/(public)/hotelreservation/(payment-callback)/payment-callback/page.tsx b/app/[lang]/(live)/(public)/hotelreservation/(payment-callback)/payment-callback/page.tsx index 364f50349..43374e32e 100644 --- a/app/[lang]/(live)/(public)/hotelreservation/(payment-callback)/payment-callback/page.tsx +++ b/app/[lang]/(live)/(public)/hotelreservation/(payment-callback)/payment-callback/page.tsx @@ -12,7 +12,7 @@ import { serverClient } from "@/lib/trpc/server" import PaymentCallback from "@/components/HotelReservation/EnterDetails/Payment/PaymentCallback" -import { LangParams, PageArgs } from "@/types/params" +import type { LangParams, PageArgs } from "@/types/params" export default async function PaymentCallbackPage({ params, diff --git a/app/[lang]/(live)/(public)/hotelreservation/(standard)/layout.tsx b/app/[lang]/(live)/(public)/hotelreservation/(standard)/layout.tsx index 66352fe80..9a2755a3e 100644 --- a/app/[lang]/(live)/(public)/hotelreservation/(standard)/layout.tsx +++ b/app/[lang]/(live)/(public)/hotelreservation/(standard)/layout.tsx @@ -1,6 +1,6 @@ import styles from "./layout.module.css" -import { LangParams, LayoutArgs } from "@/types/params" +import type { LangParams, LayoutArgs } from "@/types/params" export default function HotelReservationLayout({ children, diff --git a/app/[lang]/(live)/(public)/hotelreservation/(standard)/select-hotel/layout.tsx b/app/[lang]/(live)/(public)/hotelreservation/(standard)/select-hotel/layout.tsx index ee96f3c10..7b1b1bbd4 100644 --- a/app/[lang]/(live)/(public)/hotelreservation/(standard)/select-hotel/layout.tsx +++ b/app/[lang]/(live)/(public)/hotelreservation/(standard)/select-hotel/layout.tsx @@ -1,6 +1,6 @@ import styles from "./layout.module.css" -import { LangParams, LayoutArgs } from "@/types/params" +import type { LangParams, LayoutArgs } from "@/types/params" export default function HotelReservationLayout({ children, diff --git a/app/[lang]/(live)/(public)/hotelreservation/(standard)/select-rate/getValidDates.ts b/app/[lang]/(live)/(public)/hotelreservation/(standard)/select-rate/getValidDates.ts index d9bcbf09e..eb879052d 100644 --- a/app/[lang]/(live)/(public)/hotelreservation/(standard)/select-rate/getValidDates.ts +++ b/app/[lang]/(live)/(public)/hotelreservation/(standard)/select-rate/getValidDates.ts @@ -1,7 +1,7 @@ -import { Dayjs } from "dayjs" - import { dt } from "@/lib/dt" +import type { Dayjs } from "dayjs" + /** * Get valid dates from stringFromDate and stringToDate making sure that they are not in the past and chronologically correct * @example const { fromDate, toDate} = getValidDates("2021-01-01", "2021-01-02") diff --git a/app/[lang]/(live)/(public)/hotelreservation/(standard)/step/page.tsx b/app/[lang]/(live)/(public)/hotelreservation/(standard)/step/page.tsx index 57e2bae83..82feef50c 100644 --- a/app/[lang]/(live)/(public)/hotelreservation/(standard)/step/page.tsx +++ b/app/[lang]/(live)/(public)/hotelreservation/(standard)/step/page.tsx @@ -29,7 +29,7 @@ import EnterDetailsProvider from "@/providers/EnterDetailsProvider" import styles from "./page.module.css" -import { SelectRateSearchParams } from "@/types/components/hotelReservation/selectRate/selectRate" +import type { SelectRateSearchParams } from "@/types/components/hotelReservation/selectRate/selectRate" import { StepEnum } from "@/types/enums/step" import type { LangParams, PageArgs } from "@/types/params" diff --git a/app/[lang]/(live)/(public)/login/route.ts b/app/[lang]/(live)/(public)/login/route.ts index 97ed46838..03933e003 100644 --- a/app/[lang]/(live)/(public)/login/route.ts +++ b/app/[lang]/(live)/(public)/login/route.ts @@ -1,4 +1,4 @@ -import { NextRequest, NextResponse } from "next/server" +import { type NextRequest, NextResponse } from "next/server" import { AuthError } from "next-auth" import { Lang } from "@/constants/languages" diff --git a/app/[lang]/(live)/(public)/verifymagiclink/route.ts b/app/[lang]/(live)/(public)/verifymagiclink/route.ts index 81fa277c3..adac7a8d4 100644 --- a/app/[lang]/(live)/(public)/verifymagiclink/route.ts +++ b/app/[lang]/(live)/(public)/verifymagiclink/route.ts @@ -1,14 +1,13 @@ -import { NextRequest, NextResponse } from "next/server" +import { type NextRequest, NextResponse } from "next/server" import { AuthError } from "next-auth" -import { Lang } from "@/constants/languages" -import { login } from "@/constants/routes/handleAuth" -import { env } from "@/env/server" import { badRequest, internalServerError } from "@/server/errors/next" import { getPublicURL } from "@/server/utils" import { signIn } from "@/auth" +import type { Lang } from "@/constants/languages" + export async function GET( request: NextRequest, context: { params: { lang: Lang } } diff --git a/app/[lang]/(live)/@bookingwidget/hotelreservation/page.tsx b/app/[lang]/(live)/@bookingwidget/hotelreservation/page.tsx index d3ec595df..a6d940572 100644 --- a/app/[lang]/(live)/@bookingwidget/hotelreservation/page.tsx +++ b/app/[lang]/(live)/@bookingwidget/hotelreservation/page.tsx @@ -2,7 +2,7 @@ import { env } from "@/env/server" import BookingWidget, { preload } from "@/components/BookingWidget" -import { PageArgs } from "@/types/params" +import type { PageArgs } from "@/types/params" export default async function BookingWidgetPage({ searchParams, diff --git a/app/[lang]/(live)/@bookingwidget/page.tsx b/app/[lang]/(live)/@bookingwidget/page.tsx index 794218e52..93e81d617 100644 --- a/app/[lang]/(live)/@bookingwidget/page.tsx +++ b/app/[lang]/(live)/@bookingwidget/page.tsx @@ -3,7 +3,7 @@ import { serverClient } from "@/lib/trpc/server" import BookingWidget, { preload } from "@/components/BookingWidget" -import { PageArgs } from "@/types/params" +import type { PageArgs } from "@/types/params" export default async function BookingWidgetPage({ searchParams, diff --git a/app/[lang]/(live)/@footer/page.tsx b/app/[lang]/(live)/@footer/page.tsx index 4edbe0b0d..90fc74d02 100644 --- a/app/[lang]/(live)/@footer/page.tsx +++ b/app/[lang]/(live)/@footer/page.tsx @@ -4,7 +4,7 @@ import CurrentFooter from "@/components/Current/Footer" import Footer, { preload } from "@/components/Footer" import { setLang } from "@/i18n/serverContext" -import { LangParams, PageArgs } from "@/types/params" +import type { LangParams, PageArgs } from "@/types/params" export default function FooterSlot({ params }: PageArgs) { setLang(params.lang) diff --git a/app/[lang]/(live)/@header/page.tsx b/app/[lang]/(live)/@header/page.tsx index 51e91035d..59c67fc02 100644 --- a/app/[lang]/(live)/@header/page.tsx +++ b/app/[lang]/(live)/@header/page.tsx @@ -7,7 +7,7 @@ import HeaderFallback from "@/components/Current/Header/HeaderFallback" import Header from "@/components/Header" import { setLang } from "@/i18n/serverContext" -import { LangParams, PageArgs } from "@/types/params" +import type { LangParams, PageArgs } from "@/types/params" export default function HeaderPage({ params }: PageArgs) { setLang(params.lang) diff --git a/app/[lang]/(live)/error.tsx b/app/[lang]/(live)/error.tsx index a39495eb7..b347ce19b 100644 --- a/app/[lang]/(live)/error.tsx +++ b/app/[lang]/(live)/error.tsx @@ -16,7 +16,7 @@ import { findLang } from "@/utils/languages" import styles from "./error.module.css" -import { LangParams } from "@/types/params" +import type { LangParams } from "@/types/params" export default function Error({ error, diff --git a/app/[lang]/(live)/middleware-error/404/page.tsx b/app/[lang]/(live)/middleware-error/404/page.tsx index f70f34995..416f2ed72 100644 --- a/app/[lang]/(live)/middleware-error/404/page.tsx +++ b/app/[lang]/(live)/middleware-error/404/page.tsx @@ -1,7 +1,7 @@ import NotFound from "@/components/Current/NotFound" import { setLang } from "@/i18n/serverContext" -import { LangParams, PageArgs } from "@/types/params" +import type { LangParams, PageArgs } from "@/types/params" export default function NotFoundPage({ params }: PageArgs) { setLang(params.lang) diff --git a/app/[lang]/(live)/middleware-error/[status]/page.tsx b/app/[lang]/(live)/middleware-error/[status]/page.tsx index 177b62af4..ecbb159a1 100644 --- a/app/[lang]/(live)/middleware-error/[status]/page.tsx +++ b/app/[lang]/(live)/middleware-error/[status]/page.tsx @@ -2,7 +2,7 @@ import { setLang } from "@/i18n/serverContext" import styles from "./page.module.css" -import { LangParams, LayoutArgs, StatusParams } from "@/types/params" +import type { LangParams, LayoutArgs, StatusParams } from "@/types/params" export default function MiddlewareError({ params, diff --git a/app/[lang]/(live-current)/@header/current-content-page/page.tsx b/app/[lang]/(live-current)/@header/current-content-page/page.tsx index 98738064a..b41776b58 100644 --- a/app/[lang]/(live-current)/@header/current-content-page/page.tsx +++ b/app/[lang]/(live-current)/@header/current-content-page/page.tsx @@ -1,7 +1,7 @@ import Header from "@/components/Current/Header" import { setLang } from "@/i18n/serverContext" -import { LangParams, PageArgs } from "@/types/params" +import type { LangParams, PageArgs } from "@/types/params" export default async function HeaderPage({ params }: PageArgs) { setLang(params.lang) diff --git a/app/[lang]/webview/[contentType]/[uid]/page.tsx b/app/[lang]/webview/[contentType]/[uid]/page.tsx index ab64c4916..54b5fa91b 100644 --- a/app/[lang]/webview/[contentType]/[uid]/page.tsx +++ b/app/[lang]/webview/[contentType]/[uid]/page.tsx @@ -7,7 +7,7 @@ import AccountPage from "@/components/Webviews/AccountPage" import LoyaltyPage from "@/components/Webviews/LoyaltyPage" import { setLang } from "@/i18n/serverContext" -import { +import type { ContentTypeWebviewParams, LangParams, PageArgs, diff --git a/app/[lang]/webview/refresh/page.tsx b/app/[lang]/webview/refresh/page.tsx index 2777f1c6d..ad258094b 100644 --- a/app/[lang]/webview/refresh/page.tsx +++ b/app/[lang]/webview/refresh/page.tsx @@ -3,7 +3,7 @@ import { setLang } from "@/i18n/serverContext" import styles from "./page.module.css" -import { LangParams, PageArgs } from "@/types/params" +import type { LangParams, PageArgs } from "@/types/params" export default function Refresh({ params }: PageArgs) { setLang(params.lang) diff --git a/app/api/web/add-card-callback/[lang]/route.ts b/app/api/web/add-card-callback/[lang]/route.ts index e664124ed..bcbeff297 100644 --- a/app/api/web/add-card-callback/[lang]/route.ts +++ b/app/api/web/add-card-callback/[lang]/route.ts @@ -1,4 +1,3 @@ -import { NextRequest } from "next/server" import { env } from "process" import { Lang } from "@/constants/languages" @@ -6,6 +5,8 @@ import { profile } from "@/constants/routes/myPages" import { serverClient } from "@/lib/trpc/server" import { getPublicURL } from "@/server/utils" +import type { NextRequest } from "next/server" + export async function GET( request: NextRequest, { params }: { params: { lang: string } } diff --git a/app/api/web/check-headers/route.ts b/app/api/web/check-headers/route.ts index 49be1b0c6..7b7cef40c 100644 --- a/app/api/web/check-headers/route.ts +++ b/app/api/web/check-headers/route.ts @@ -1,6 +1,4 @@ -import { NextResponse } from "next/server" - -import type { NextRequest } from "next/server" +import { type NextRequest, NextResponse } from "next/server" export async function GET(request: NextRequest) { return NextResponse.json(Object.fromEntries(request.headers.entries())) diff --git a/app/api/web/revalidate/loyaltyConfig/route.ts b/app/api/web/revalidate/loyaltyConfig/route.ts index 131b583d1..b63cf9559 100644 --- a/app/api/web/revalidate/loyaltyConfig/route.ts +++ b/app/api/web/revalidate/loyaltyConfig/route.ts @@ -1,6 +1,5 @@ import { revalidateTag } from "next/cache" import { headers } from "next/headers" -import { NextRequest } from "next/server" import { z } from "zod" import { Lang } from "@/constants/languages" @@ -9,6 +8,8 @@ import { badRequest, internalServerError, notFound } from "@/server/errors/next" import { generateLoyaltyConfigTag } from "@/utils/generateTag" +import type { NextRequest } from "next/server" + enum LoyaltyConfigContentTypes { loyalty_level = "loyalty_level", reward = "reward", diff --git a/app/api/web/revalidate/manually/route.ts b/app/api/web/revalidate/manually/route.ts index ac9ffad50..a4b3bfdc9 100644 --- a/app/api/web/revalidate/manually/route.ts +++ b/app/api/web/revalidate/manually/route.ts @@ -1,12 +1,13 @@ import { revalidateTag } from "next/cache" import { headers } from "next/headers" -import { Lang } from "@/constants/languages" import { env } from "@/env/server" import { badRequest, internalServerError } from "@/server/errors/next" import { generateTag } from "@/utils/generateTag" +import type { Lang } from "@/constants/languages" + // This file is primarily to be used locally to test // purging your cache for new (and old) requests export async function POST() { diff --git a/app/api/web/revalidate/route.ts b/app/api/web/revalidate/route.ts index 63a7b157b..3e5038b7d 100644 --- a/app/api/web/revalidate/route.ts +++ b/app/api/web/revalidate/route.ts @@ -1,6 +1,5 @@ import { revalidateTag } from "next/cache" import { headers } from "next/headers" -import { NextRequest } from "next/server" import { z } from "zod" import { Lang } from "@/constants/languages" @@ -17,6 +16,8 @@ import { generateTag, } from "@/utils/generateTag" +import type { NextRequest } from "next/server" + const validateJsonBody = z.object({ data: z.object({ content_type: z.object({ diff --git a/components/Blocks/DynamicContent/LoyaltyLevels/index.tsx b/components/Blocks/DynamicContent/LoyaltyLevels/index.tsx index f23130e7d..8a4583204 100644 --- a/components/Blocks/DynamicContent/LoyaltyLevels/index.tsx +++ b/components/Blocks/DynamicContent/LoyaltyLevels/index.tsx @@ -12,7 +12,7 @@ import SectionWrapper from "../SectionWrapper" import styles from "./loyaltyLevels.module.css" -import { LoyaltyLevelsProps } from "@/types/components/blocks/dynamicContent" +import type { LoyaltyLevelsProps } from "@/types/components/blocks/dynamicContent" import type { LevelCardProps } from "@/types/components/overviewTable" export default async function LoyaltyLevels({ diff --git a/components/Blocks/DynamicContent/Overview/Friend/Hero/hero.ts b/components/Blocks/DynamicContent/Overview/Friend/Hero/hero.ts index e672e9de2..0f2adcec4 100644 --- a/components/Blocks/DynamicContent/Overview/Friend/Hero/hero.ts +++ b/components/Blocks/DynamicContent/Overview/Friend/Hero/hero.ts @@ -1,6 +1,6 @@ -import { VariantProps } from "class-variance-authority" +import type { VariantProps } from "class-variance-authority" -import { heroVariants } from "./heroVariants" +import type { heroVariants } from "./heroVariants" export interface HeroProps extends Omit, "color">, diff --git a/components/Blocks/DynamicContent/Overview/Friend/Hero/index.tsx b/components/Blocks/DynamicContent/Overview/Friend/Hero/index.tsx index 3ec3083ba..7b783e485 100644 --- a/components/Blocks/DynamicContent/Overview/Friend/Hero/index.tsx +++ b/components/Blocks/DynamicContent/Overview/Friend/Hero/index.tsx @@ -1,6 +1,7 @@ -import { HeroProps } from "./hero" import { heroVariants } from "./heroVariants" +import type { HeroProps } from "./hero" + export default function Hero({ className, color, children }: HeroProps) { const classNames = heroVariants({ className, color }) return
{children}
diff --git a/components/Blocks/DynamicContent/Overview/Stats/Points/index.tsx b/components/Blocks/DynamicContent/Overview/Stats/Points/index.tsx index 1da672402..d06581ff7 100644 --- a/components/Blocks/DynamicContent/Overview/Stats/Points/index.tsx +++ b/components/Blocks/DynamicContent/Overview/Stats/Points/index.tsx @@ -7,7 +7,7 @@ import { getMembership } from "@/utils/user" import PointsContainer from "./Container" import { NextLevelPointsColumn, YourPointsColumn } from "./PointsColumn" -import { UserProps } from "@/types/components/myPages/user" +import type { UserProps } from "@/types/components/myPages/user" export default async function Points({ user }: UserProps) { const intl = await getIntl() diff --git a/components/Blocks/DynamicContent/OverviewTable/Client.tsx b/components/Blocks/DynamicContent/OverviewTable/Client.tsx index 1754fce72..ce1d9b8bd 100644 --- a/components/Blocks/DynamicContent/OverviewTable/Client.tsx +++ b/components/Blocks/DynamicContent/OverviewTable/Client.tsx @@ -4,7 +4,7 @@ import { useReducer } from "react" import { useIntl } from "react-intl" import { - MembershipLevel, + type MembershipLevel, MembershipLevelEnum, } from "@/constants/membershipLevels" @@ -22,8 +22,8 @@ import styles from "./overviewTable.module.css" import type { Key } from "react-aria-components" import { - ComparisonLevel, - DesktopSelectColumns, + type ComparisonLevel, + type DesktopSelectColumns, type MobileColumnHeaderProps, OverviewTableActionsEnum, type OverviewTableClientProps, diff --git a/components/Blocks/DynamicContent/OverviewTable/index.tsx b/components/Blocks/DynamicContent/OverviewTable/index.tsx index f39fb9a25..062f7f32e 100644 --- a/components/Blocks/DynamicContent/OverviewTable/index.tsx +++ b/components/Blocks/DynamicContent/OverviewTable/index.tsx @@ -4,7 +4,7 @@ import { serverClient } from "@/lib/trpc/server" import SectionWrapper from "../SectionWrapper" import OverviewTableClient from "./Client" -import { OverviewTableProps } from "@/types/components/blocks/dynamicContent" +import type { OverviewTableProps } from "@/types/components/blocks/dynamicContent" export default async function OverviewTable({ dynamic_content, diff --git a/components/Blocks/DynamicContent/OverviewTable/reducer.ts b/components/Blocks/DynamicContent/OverviewTable/reducer.ts index b2fd7372d..d6e3f1483 100644 --- a/components/Blocks/DynamicContent/OverviewTable/reducer.ts +++ b/components/Blocks/DynamicContent/OverviewTable/reducer.ts @@ -9,7 +9,7 @@ import { type LevelWithRewards, OverviewTableActionsEnum, type OverviewTableClientProps, - OverviewTableReducerAction, + type OverviewTableReducerAction, } from "@/types/components/overviewTable" export function getLevel( diff --git a/components/Blocks/DynamicContent/Points/EarnAndBurn/JourneyTable/Client.tsx b/components/Blocks/DynamicContent/Points/EarnAndBurn/JourneyTable/Client.tsx index 76fb8fa06..7bd58dd2e 100644 --- a/components/Blocks/DynamicContent/Points/EarnAndBurn/JourneyTable/Client.tsx +++ b/components/Blocks/DynamicContent/Points/EarnAndBurn/JourneyTable/Client.tsx @@ -10,7 +10,7 @@ import Pagination from "@/components/MyPages/Pagination" import ClientTable from "./ClientTable" -import { Transactions } from "@/types/components/myPages/myPage/earnAndBurn" +import type { Transactions } from "@/types/components/myPages/myPage/earnAndBurn" export default function TransactionTable({ initialJourneyTransactions, diff --git a/components/Blocks/DynamicContent/Points/ExpiringPoints/index.tsx b/components/Blocks/DynamicContent/Points/ExpiringPoints/index.tsx index 8b0206351..2614615eb 100644 --- a/components/Blocks/DynamicContent/Points/ExpiringPoints/index.tsx +++ b/components/Blocks/DynamicContent/Points/ExpiringPoints/index.tsx @@ -5,7 +5,7 @@ import SectionHeader from "@/components/Section/Header" import ExpiringPointsTable from "./ExpiringPointsTable" -import { AccountPageComponentProps } from "@/types/components/myPages/myPage/accountPage" +import type { AccountPageComponentProps } from "@/types/components/myPages/myPage/accountPage" export default async function ExpiringPoints({ link, diff --git a/components/Blocks/DynamicContent/Points/Overview/Points/index.tsx b/components/Blocks/DynamicContent/Points/Overview/Points/index.tsx index dc42f86de..b11699391 100644 --- a/components/Blocks/DynamicContent/Points/Overview/Points/index.tsx +++ b/components/Blocks/DynamicContent/Points/Overview/Points/index.tsx @@ -12,8 +12,8 @@ import { YourPointsColumn, } from "../../../Overview/Stats/Points/PointsColumn" -import { UserProps } from "@/types/components/myPages/user" -import { LangParams } from "@/types/params" +import type { UserProps } from "@/types/components/myPages/user" +import type { LangParams } from "@/types/params" /* TODO */ export default async function Points({ user, lang }: UserProps & LangParams) { diff --git a/components/Blocks/DynamicContent/Rewards/RewardIcon/data.ts b/components/Blocks/DynamicContent/Rewards/RewardIcon/data.ts index a6396f3cf..fcb388b64 100644 --- a/components/Blocks/DynamicContent/Rewards/RewardIcon/data.ts +++ b/components/Blocks/DynamicContent/Rewards/RewardIcon/data.ts @@ -1,8 +1,8 @@ -import { FC } from "react" - import { getIconByIconName } from "@/components/Icons/get-icon-by-icon-name" import { isValidRewardId } from "@/utils/rewards" +import type { FC } from "react" + import { IconName, type IconProps } from "@/types/components/icon" import { RewardId } from "@/types/enums/rewards" diff --git a/components/Blocks/DynamicContent/Rewards/RewardIcon/index.tsx b/components/Blocks/DynamicContent/Rewards/RewardIcon/index.tsx index 8c3f53c6f..082d20f54 100644 --- a/components/Blocks/DynamicContent/Rewards/RewardIcon/index.tsx +++ b/components/Blocks/DynamicContent/Rewards/RewardIcon/index.tsx @@ -1,6 +1,6 @@ import { mapRewardToIcon } from "./data" -import { RewardIconProps } from "@/types/components/myPages/rewards" +import type { RewardIconProps } from "@/types/components/myPages/rewards" // Original SVG aspect ratio is 358:202 (≈1.77:1) const sizeMap = { diff --git a/components/Blocks/DynamicContent/SignupFormWrapper/index.tsx b/components/Blocks/DynamicContent/SignupFormWrapper/index.tsx index 7daf85588..e93785b0e 100644 --- a/components/Blocks/DynamicContent/SignupFormWrapper/index.tsx +++ b/components/Blocks/DynamicContent/SignupFormWrapper/index.tsx @@ -6,7 +6,7 @@ import { getProfileSafely } from "@/lib/trpc/memoizedRequests" import SignupForm from "@/components/Forms/Signup" import { getLang } from "@/i18n/serverContext" -import { SignupFormWrapperProps } from "@/types/components/blocks/dynamicContent" +import type { SignupFormWrapperProps } from "@/types/components/blocks/dynamicContent" export default async function SignupFormWrapper({ dynamic_content, diff --git a/components/Blocks/DynamicContent/Stays/Soonest/index.tsx b/components/Blocks/DynamicContent/Stays/Soonest/index.tsx index 0aaa2316c..c0a16f04a 100644 --- a/components/Blocks/DynamicContent/Stays/Soonest/index.tsx +++ b/components/Blocks/DynamicContent/Stays/Soonest/index.tsx @@ -8,7 +8,7 @@ import Grids from "@/components/TempDesignSystem/Grids" import StayCard from "../StayCard" import EmptyUpcomingStaysBlock from "./EmptyUpcomingStays" -import { AccountPageComponentProps } from "@/types/components/myPages/myPage/accountPage" +import type { AccountPageComponentProps } from "@/types/components/myPages/myPage/accountPage" export default async function SoonestStays({ title, diff --git a/components/Blocks/UspGrid/utils.ts b/components/Blocks/UspGrid/utils.ts index 700482909..47d5ce76c 100644 --- a/components/Blocks/UspGrid/utils.ts +++ b/components/Blocks/UspGrid/utils.ts @@ -1,4 +1,4 @@ -import { UspIcon } from "@/types/components/blocks/uspGrid" +import type { UspIcon } from "@/types/components/blocks/uspGrid" import { IconName } from "@/types/components/icon" export function getUspIconName(icon?: UspIcon | null) { diff --git a/components/ContentType/HotelPage/IntroSection/types.ts b/components/ContentType/HotelPage/IntroSection/types.ts index 88c23f13b..bdb15d8b9 100644 --- a/components/ContentType/HotelPage/IntroSection/types.ts +++ b/components/ContentType/HotelPage/IntroSection/types.ts @@ -1,4 +1,4 @@ -import { +import type { HotelAddress, HotelData, HotelLocation, diff --git a/components/ContentType/HotelPage/Map/MapWithCard/index.tsx b/components/ContentType/HotelPage/Map/MapWithCard/index.tsx index b544e39d3..e775dee5b 100644 --- a/components/ContentType/HotelPage/Map/MapWithCard/index.tsx +++ b/components/ContentType/HotelPage/Map/MapWithCard/index.tsx @@ -1,6 +1,6 @@ "use client" -import { PropsWithChildren, useRef } from "react" +import { type PropsWithChildren, useRef } from "react" import { StickyElementNameEnum } from "@/stores/sticky-position" diff --git a/components/ContentType/HotelPage/SidePeeks/WellnessAndExercise/Facility/index.tsx b/components/ContentType/HotelPage/SidePeeks/WellnessAndExercise/Facility/index.tsx index 3357765ad..ab1114dbb 100644 --- a/components/ContentType/HotelPage/SidePeeks/WellnessAndExercise/Facility/index.tsx +++ b/components/ContentType/HotelPage/SidePeeks/WellnessAndExercise/Facility/index.tsx @@ -6,7 +6,7 @@ import { getIntl } from "@/i18n" import styles from "./facility.module.css" -import { FacilityProps } from "@/types/components/hotelPage/sidepeek/facility" +import type { FacilityProps } from "@/types/components/hotelPage/sidepeek/facility" export default async function Facility({ data }: FacilityProps) { const intl = await getIntl() diff --git a/components/ContentType/HotelPage/data.ts b/components/ContentType/HotelPage/data.ts index 81ae2b438..3d7faad2f 100644 --- a/components/ContentType/HotelPage/data.ts +++ b/components/ContentType/HotelPage/data.ts @@ -1,8 +1,8 @@ -import { FC } from "react" - import { getIconByIconName } from "@/components/Icons/get-icon-by-icon-name" -import { IconName, IconProps } from "@/types/components/icon" +import type { FC } from "react" + +import { IconName, type IconProps } from "@/types/components/icon" import { FacilityEnum } from "@/types/enums/facilities" const facilityToIconMap: Record = { diff --git a/components/ContentType/StaticPages/staticPage.ts b/components/ContentType/StaticPages/staticPage.ts index 5a3bf84b4..d23d7b525 100644 --- a/components/ContentType/StaticPages/staticPage.ts +++ b/components/ContentType/StaticPages/staticPage.ts @@ -1,10 +1,9 @@ -import { staticPageVariants } from "./variants" - import type { VariantProps } from "class-variance-authority" import type { TrackingSDKPageData } from "@/types/components/tracking" import type { CollectionPage } from "@/types/trpc/routers/contentstack/collectionPage" import type { ContentPage } from "@/types/trpc/routers/contentstack/contentPage" +import type { staticPageVariants } from "./variants" export interface StaticPageProps extends Omit, "content">, diff --git a/components/Current/Blocks/List/ListItem.tsx b/components/Current/Blocks/List/ListItem.tsx index 2bbd470f4..12fdcd476 100644 --- a/components/Current/Blocks/List/ListItem.tsx +++ b/components/Current/Blocks/List/ListItem.tsx @@ -2,8 +2,7 @@ import { cva } from "class-variance-authority" import styles from "./list.module.css" -import type { ListItem } from "@/types/requests/blocks/list" -import { BlockListItemsEnum } from "@/types/requests/blocks/list" +import { BlockListItemsEnum, type ListItem } from "@/types/requests/blocks/list" const config = { variants: { diff --git a/components/Current/Header/LanguageSwitcher/Desktop/index.tsx b/components/Current/Header/LanguageSwitcher/Desktop/index.tsx index 10ca94c15..a2a81c060 100644 --- a/components/Current/Header/LanguageSwitcher/Desktop/index.tsx +++ b/components/Current/Header/LanguageSwitcher/Desktop/index.tsx @@ -1,7 +1,7 @@ "use client" import { useCallback, useEffect, useRef, useState } from "react" -import { Lang, languages } from "@/constants/languages" +import { type Lang, languages } from "@/constants/languages" import Link from "@/components/TempDesignSystem/Link" import useLang from "@/hooks/useLang" diff --git a/components/Current/Header/LanguageSwitcher/Mobile/index.tsx b/components/Current/Header/LanguageSwitcher/Mobile/index.tsx index d8081227d..45be5f078 100644 --- a/components/Current/Header/LanguageSwitcher/Mobile/index.tsx +++ b/components/Current/Header/LanguageSwitcher/Mobile/index.tsx @@ -1,7 +1,7 @@ "use client" import { useState } from "react" -import { Lang, languages } from "@/constants/languages" +import { type Lang, languages } from "@/constants/languages" import useLang from "@/hooks/useLang" diff --git a/components/Current/Header/LanguageSwitcher/index.tsx b/components/Current/Header/LanguageSwitcher/index.tsx index bac3be427..0aa160255 100644 --- a/components/Current/Header/LanguageSwitcher/index.tsx +++ b/components/Current/Header/LanguageSwitcher/index.tsx @@ -1,7 +1,7 @@ import Desktop from "./Desktop" import Mobile from "./Mobile" -import { LanguageSwitcherData } from "@/types/requests/languageSwitcher" +import type { LanguageSwitcherData } from "@/types/requests/languageSwitcher" type LanguageSwitcherProps = { urls: LanguageSwitcherData } diff --git a/components/Current/Header/MyPagesMobileDropdown/index.tsx b/components/Current/Header/MyPagesMobileDropdown/index.tsx index be58e53b5..753a87594 100644 --- a/components/Current/Header/MyPagesMobileDropdown/index.tsx +++ b/components/Current/Header/MyPagesMobileDropdown/index.tsx @@ -3,7 +3,6 @@ import { Fragment } from "react" import { useIntl } from "react-intl" import { logout } from "@/constants/routes/handleAuth" -import { navigationQueryRouter } from "@/server/routers/contentstack/myPages/navigation/query" import useDropdownStore from "@/stores/main-menu" import Divider from "@/components/TempDesignSystem/Divider" @@ -14,6 +13,7 @@ import useLang from "@/hooks/useLang" import styles from "./my-pages-mobile-dropdown.module.css" import { DropdownTypeEnum } from "@/types/components/dropdown/dropdown" +import type { navigationQueryRouter } from "@/server/routers/contentstack/myPages/navigation/query" type Navigation = Awaited> diff --git a/components/Current/NotFound/Texts.ts b/components/Current/NotFound/Texts.ts index cb1fd017a..c07b406ba 100644 --- a/components/Current/NotFound/Texts.ts +++ b/components/Current/NotFound/Texts.ts @@ -1,4 +1,4 @@ -import { Lang } from "@/constants/languages" +import type { Lang } from "@/constants/languages" type Texts = { title: string diff --git a/components/Current/Tracking.tsx b/components/Current/Tracking.tsx index de366aae5..8c2d33490 100644 --- a/components/Current/Tracking.tsx +++ b/components/Current/Tracking.tsx @@ -3,7 +3,7 @@ import { usePathname, useSearchParams } from "next/navigation" import { useEffect, useState } from "react" -import { +import type { SiteSectionObject, TrackingData, TrackingProps, diff --git a/components/Current/currentRenderOptions.tsx b/components/Current/currentRenderOptions.tsx index 2360e1805..c184f5497 100644 --- a/components/Current/currentRenderOptions.tsx +++ b/components/Current/currentRenderOptions.tsx @@ -7,13 +7,13 @@ import type { EmbedByUid } from "@/types/components/deprecatedjsontohtml" import { EmbedEnum } from "@/types/requests/utils/embeds" import type { Attributes } from "@/types/rte/attrs" import { RTEItemTypeEnum, RTETypeEnum } from "@/types/rte/enums" -import type { - RTEDefaultNode, - RTENext, - RTENode, - RTERegularNode, +import { + type RTEDefaultNode, + RTEMarkType, + type RTENext, + type RTENode, + type RTERegularNode, } from "@/types/rte/node" -import { RTEMarkType } from "@/types/rte/node" import type { RenderOptions } from "@/types/rte/option" function extractPossibleAttributes(attrs: Attributes | undefined) { diff --git a/components/DeprecatedJsonToHtml/renderOptions.tsx b/components/DeprecatedJsonToHtml/renderOptions.tsx index c22f469e0..148993ded 100644 --- a/components/DeprecatedJsonToHtml/renderOptions.tsx +++ b/components/DeprecatedJsonToHtml/renderOptions.tsx @@ -17,7 +17,7 @@ import { hasAvailableParagraphFormat, hasAvailableULFormat } from "./utils" import styles from "./jsontohtml.module.css" import type { EmbedByUid } from "@/types/components/deprecatedjsontohtml" -import { ImageVaultAsset } from "@/types/components/imageVault" +import type { ImageVaultAsset } from "@/types/components/imageVault" import { EmbedEnum } from "@/types/requests/utils/embeds" import type { Attributes, RTEImageVaultAttrs } from "@/types/rte/attrs" import { @@ -25,15 +25,15 @@ import { RTEItemTypeEnum, RTETypeEnum, } from "@/types/rte/enums" -import type { - RTEDefaultNode, - RTEImageNode, - RTENext, - RTENode, - RTERegularNode, - RTETextNode, +import { + type RTEDefaultNode, + type RTEImageNode, + RTEMarkType, + type RTENext, + type RTENode, + type RTERegularNode, + type RTETextNode, } from "@/types/rte/node" -import { RTEMarkType } from "@/types/rte/node" import type { RenderOptions } from "@/types/rte/option" function extractPossibleAttributes(attrs: Attributes | undefined) { diff --git a/components/DeprecatedJsonToHtml/utils.tsx b/components/DeprecatedJsonToHtml/utils.tsx index 347a23106..c87a26a96 100644 --- a/components/DeprecatedJsonToHtml/utils.tsx +++ b/components/DeprecatedJsonToHtml/utils.tsx @@ -8,12 +8,13 @@ import { AvailableULFormatEnum, RTETypeEnum, } from "@/types/rte/enums" -import type { - RTENode, - RTERenderOptionComponent, - RTETextNode, +import { + RTEMarkType, + type RTENode, + type RTERenderMark, + type RTERenderOptionComponent, + type RTETextNode, } from "@/types/rte/node" -import { RTEMarkType, RTERenderMark } from "@/types/rte/node" import type { RenderOptions } from "@/types/rte/option" export function groupEmbedsByUid(embedsArray: Node[]) { diff --git a/components/Footer/Details/index.tsx b/components/Footer/Details/index.tsx index b95c20cca..7827f6043 100644 --- a/components/Footer/Details/index.tsx +++ b/components/Footer/Details/index.tsx @@ -12,7 +12,7 @@ import { getLang } from "@/i18n/serverContext" import styles from "./details.module.css" import type { SocialIconsProps } from "@/types/components/footer/socialIcons" -import { IconName } from "@/types/components/icon" +import type { IconName } from "@/types/components/icon" function SocialIcon({ iconName }: SocialIconsProps) { const SocialIcon = getIconByIconName(iconName as IconName) diff --git a/components/Forms/BookingWidget/FormContent/Input/index.tsx b/components/Forms/BookingWidget/FormContent/Input/index.tsx index 160279b75..dfa5e018a 100644 --- a/components/Forms/BookingWidget/FormContent/Input/index.tsx +++ b/components/Forms/BookingWidget/FormContent/Input/index.tsx @@ -1,4 +1,4 @@ -import React, { forwardRef, InputHTMLAttributes } from "react" +import React, { forwardRef, type InputHTMLAttributes } from "react" import { Input as InputRAC } from "react-aria-components" import Body from "@/components/TempDesignSystem/Text/Body" diff --git a/components/Forms/BookingWidget/FormContent/Search/index.tsx b/components/Forms/BookingWidget/FormContent/Search/index.tsx index 4d833a5e4..28b53bb1b 100644 --- a/components/Forms/BookingWidget/FormContent/Search/index.tsx +++ b/components/Forms/BookingWidget/FormContent/Search/index.tsx @@ -1,9 +1,9 @@ "use client" import Downshift from "downshift" import { - ChangeEvent, - FocusEvent, - FormEvent, + type ChangeEvent, + type FocusEvent, + type FormEvent, useCallback, useEffect, useReducer, diff --git a/components/Forms/BookingWidget/index.tsx b/components/Forms/BookingWidget/index.tsx index 86847ce2e..3d0a67b20 100644 --- a/components/Forms/BookingWidget/index.tsx +++ b/components/Forms/BookingWidget/index.tsx @@ -14,7 +14,7 @@ import styles from "./form.module.css" import type { BookingWidgetSchema } from "@/types/components/bookingWidget" import type { BookingWidgetFormProps } from "@/types/components/form/bookingwidget" -import { Location } from "@/types/trpc/routers/hotel/locations" +import type { Location } from "@/types/trpc/routers/hotel/locations" const formId = "booking-widget" diff --git a/components/Forms/Signup/index.tsx b/components/Forms/Signup/index.tsx index e8a32e8c6..4af165ca3 100644 --- a/components/Forms/Signup/index.tsx +++ b/components/Forms/Signup/index.tsx @@ -26,7 +26,7 @@ import Title from "@/components/TempDesignSystem/Text/Title" import { toast } from "@/components/TempDesignSystem/Toasts" import useLang from "@/hooks/useLang" -import { SignUpSchema, signUpSchema } from "./schema" +import { type SignUpSchema, signUpSchema } from "./schema" import styles from "./form.module.css" @@ -191,7 +191,7 @@ export default function SignupForm({ link, subtitle, title }: SignUpFormProps) { - {/* + {/* This is a manual validation trigger workaround: - The Controller component (which Input uses) doesn't re-render on submit, which prevents automatic error display. diff --git a/components/GuestsRoomsPicker/AdultSelector/index.tsx b/components/GuestsRoomsPicker/AdultSelector/index.tsx index 008037300..94884200b 100644 --- a/components/GuestsRoomsPicker/AdultSelector/index.tsx +++ b/components/GuestsRoomsPicker/AdultSelector/index.tsx @@ -9,7 +9,7 @@ import Counter from "../Counter" import styles from "./adult-selector.module.css" -import { SelectorProps } from "@/types/components/bookingWidget/guestsRoomsPicker" +import type { SelectorProps } from "@/types/components/bookingWidget/guestsRoomsPicker" export default function AdultSelector({ roomIndex = 0, diff --git a/components/GuestsRoomsPicker/ChildSelector/ChildInfoSelector.tsx b/components/GuestsRoomsPicker/ChildSelector/ChildInfoSelector.tsx index 95bb9fc0c..c609d7d6e 100644 --- a/components/GuestsRoomsPicker/ChildSelector/ChildInfoSelector.tsx +++ b/components/GuestsRoomsPicker/ChildSelector/ChildInfoSelector.tsx @@ -10,7 +10,7 @@ import Caption from "@/components/TempDesignSystem/Text/Caption" import styles from "./child-selector.module.css" import { ChildBedMapEnum } from "@/types/components/bookingWidget/enums" -import { +import type { ChildBed, ChildInfoSelectorProps, } from "@/types/components/bookingWidget/guestsRoomsPicker" diff --git a/components/GuestsRoomsPicker/ChildSelector/index.tsx b/components/GuestsRoomsPicker/ChildSelector/index.tsx index be0695ae4..b76517528 100644 --- a/components/GuestsRoomsPicker/ChildSelector/index.tsx +++ b/components/GuestsRoomsPicker/ChildSelector/index.tsx @@ -10,7 +10,7 @@ import ChildInfoSelector from "./ChildInfoSelector" import styles from "./child-selector.module.css" -import { SelectorProps } from "@/types/components/bookingWidget/guestsRoomsPicker" +import type { SelectorProps } from "@/types/components/bookingWidget/guestsRoomsPicker" export default function ChildSelector({ roomIndex = 0, diff --git a/components/GuestsRoomsPicker/Form.tsx b/components/GuestsRoomsPicker/Form.tsx index c93d6ed71..97048bf4c 100644 --- a/components/GuestsRoomsPicker/Form.tsx +++ b/components/GuestsRoomsPicker/Form.tsx @@ -14,9 +14,9 @@ import ChildSelector from "./ChildSelector" import styles from "./guests-rooms-picker.module.css" -import { BookingWidgetSchema } from "@/types/components/bookingWidget" +import type { BookingWidgetSchema } from "@/types/components/bookingWidget" import { ChildBedMapEnum } from "@/types/components/bookingWidget/enums" -import { GuestsRoom } from "@/types/components/bookingWidget/guestsRoomsPicker" +import type { GuestsRoom } from "@/types/components/bookingWidget/guestsRoomsPicker" export default function GuestsRoomsPickerDialog({ rooms, diff --git a/components/GuestsRoomsPicker/index.tsx b/components/GuestsRoomsPicker/index.tsx index 875e53629..e45a671bd 100644 --- a/components/GuestsRoomsPicker/index.tsx +++ b/components/GuestsRoomsPicker/index.tsx @@ -18,7 +18,7 @@ import PickerForm from "./Form" import styles from "./guests-rooms-picker.module.css" -import { GuestsRoom } from "@/types/components/bookingWidget/guestsRoomsPicker" +import type { GuestsRoom } from "@/types/components/bookingWidget/guestsRoomsPicker" export default function GuestsRoomsPickerForm() { const { watch, trigger } = useFormContext() diff --git a/components/Hero/index.tsx b/components/Hero/index.tsx index 0c1df4108..c4dbdc72d 100644 --- a/components/Hero/index.tsx +++ b/components/Hero/index.tsx @@ -1,9 +1,9 @@ import Image from "@/components/Image" -import { HeroProps } from "./hero" - import styles from "./hero.module.css" +import type { HeroProps } from "./hero" + export default async function Hero({ alt, src, focalPoint }: HeroProps) { return ( , "color">, VariantProps { diff --git a/components/LoginButton/index.tsx b/components/LoginButton/index.tsx index 89cc3a42a..0b27fe431 100644 --- a/components/LoginButton/index.tsx +++ b/components/LoginButton/index.tsx @@ -1,16 +1,16 @@ "use client" -import { PropsWithChildren, useEffect } from "react" +import { type PropsWithChildren, useEffect } from "react" import { login } from "@/constants/routes/handleAuth" import Link from "@/components/TempDesignSystem/Link" -import { LinkProps } from "@/components/TempDesignSystem/Link/link" import useLang from "@/hooks/useLang" import { useLazyPathname } from "@/hooks/useLazyPathname" import { trackLoginClick } from "@/utils/tracking" -import { TrackingPosition } from "@/types/components/tracking" +import type { TrackingPosition } from "@/types/components/tracking" +import type { LinkProps } from "@/components/TempDesignSystem/Link/link" export default function LoginButton({ position, diff --git a/components/Maps/StaticMap/index.tsx b/components/Maps/StaticMap/index.tsx index 6db5eada3..510b6b1b8 100644 --- a/components/Maps/StaticMap/index.tsx +++ b/components/Maps/StaticMap/index.tsx @@ -3,7 +3,7 @@ import { env } from "@/env/server" import { getUrlWithSignature } from "@/utils/map" -import { StaticMapProps } from "@/types/components/maps/staticMap" +import type { StaticMapProps } from "@/types/components/maps/staticMap" function getCenter({ coordinates, diff --git a/components/MyPages/Avatar/index.tsx b/components/MyPages/Avatar/index.tsx index d8f97bdd3..07201e5bc 100644 --- a/components/MyPages/Avatar/index.tsx +++ b/components/MyPages/Avatar/index.tsx @@ -2,7 +2,7 @@ import { getInitials } from "@/utils/user" import styles from "./avatar.module.css" -import { User } from "@/types/user" +import type { User } from "@/types/user" export default function Avatar({ firstName, diff --git a/components/MyPages/Pagination/index.tsx b/components/MyPages/Pagination/index.tsx index 02f8dd1f6..31303ef64 100644 --- a/components/MyPages/Pagination/index.tsx +++ b/components/MyPages/Pagination/index.tsx @@ -2,7 +2,7 @@ import { ChevronRightIcon } from "@/components/Icons" import styles from "./pagination.module.css" -import { +import type { PaginationButtonProps, PaginationProps, } from "@/types/components/myPages/pagination" diff --git a/components/Section/Link/index.tsx b/components/Section/Link/index.tsx index a4acab664..4b76d8dbf 100644 --- a/components/Section/Link/index.tsx +++ b/components/Section/Link/index.tsx @@ -1,11 +1,12 @@ import ArrowRight from "@/components/Icons/ArrowRight" import Link from "@/components/TempDesignSystem/Link" -import { SectionLinkProps } from "./link" import { linkVariants } from "./variants" import styles from "./link.module.css" +import type { SectionLinkProps } from "./link" + export default function SectionLink({ link, variant }: SectionLinkProps) { if (!link) { return null diff --git a/components/Section/Link/link.ts b/components/Section/Link/link.ts index a5a39a9a1..0cde53a5b 100644 --- a/components/Section/Link/link.ts +++ b/components/Section/Link/link.ts @@ -1,7 +1,7 @@ -import { linkVariants } from "./variants" - import type { VariantProps } from "class-variance-authority" +import type { linkVariants } from "./variants" + export interface SectionLinkProps extends React.PropsWithChildren>, VariantProps { diff --git a/components/SidePeeks/HotelSidePeek/Accordions/Accessibility.tsx b/components/SidePeeks/HotelSidePeek/Accordions/Accessibility.tsx index ed21708d1..a89cbfcdb 100644 --- a/components/SidePeeks/HotelSidePeek/Accordions/Accessibility.tsx +++ b/components/SidePeeks/HotelSidePeek/Accordions/Accessibility.tsx @@ -3,7 +3,7 @@ import { useIntl } from "react-intl" import AccordionItem from "@/components/TempDesignSystem/Accordion/AccordionItem" import Body from "@/components/TempDesignSystem/Text/Body" -import { AccessibilityProps } from "@/types/components/hotelReservation/selectHotel/selectHotel" +import type { AccessibilityProps } from "@/types/components/hotelReservation/selectHotel/selectHotel" import { IconName } from "@/types/components/icon" export default function Accessibility({ diff --git a/components/SidePeeks/HotelSidePeek/Accordions/CheckInCheckOut.tsx b/components/SidePeeks/HotelSidePeek/Accordions/CheckInCheckOut.tsx index 6848bc801..58491f084 100644 --- a/components/SidePeeks/HotelSidePeek/Accordions/CheckInCheckOut.tsx +++ b/components/SidePeeks/HotelSidePeek/Accordions/CheckInCheckOut.tsx @@ -3,7 +3,7 @@ import { useIntl } from "react-intl" import AccordionItem from "@/components/TempDesignSystem/Accordion/AccordionItem" import Body from "@/components/TempDesignSystem/Text/Body" -import { CheckInCheckOutProps } from "@/types/components/hotelReservation/selectHotel/selectHotel" +import type { CheckInCheckOutProps } from "@/types/components/hotelReservation/selectHotel/selectHotel" import { IconName } from "@/types/components/icon" export default function CheckinCheckOut({ checkin }: CheckInCheckOutProps) { diff --git a/components/SidePeeks/HotelSidePeek/Accordions/MeetingsAndConferences.tsx b/components/SidePeeks/HotelSidePeek/Accordions/MeetingsAndConferences.tsx index 8168a764f..1341a1068 100644 --- a/components/SidePeeks/HotelSidePeek/Accordions/MeetingsAndConferences.tsx +++ b/components/SidePeeks/HotelSidePeek/Accordions/MeetingsAndConferences.tsx @@ -3,7 +3,7 @@ import { useIntl } from "react-intl" import AccordionItem from "@/components/TempDesignSystem/Accordion/AccordionItem" import Body from "@/components/TempDesignSystem/Text/Body" -import { MeetingsAndConferencesProps } from "@/types/components/hotelReservation/selectHotel/selectHotel" +import type { MeetingsAndConferencesProps } from "@/types/components/hotelReservation/selectHotel/selectHotel" import { IconName } from "@/types/components/icon" export default function MeetingsAndConferences({ diff --git a/components/SidePeeks/HotelSidePeek/Accordions/Parking.tsx b/components/SidePeeks/HotelSidePeek/Accordions/Parking.tsx index ba4ee33f7..c172e2f7c 100644 --- a/components/SidePeeks/HotelSidePeek/Accordions/Parking.tsx +++ b/components/SidePeeks/HotelSidePeek/Accordions/Parking.tsx @@ -6,7 +6,7 @@ import Subtitle from "@/components/TempDesignSystem/Text/Subtitle" import styles from "./sidePeekAccordion.module.css" -import { ParkingProps } from "@/types/components/hotelReservation/selectHotel/selectHotel" +import type { ParkingProps } from "@/types/components/hotelReservation/selectHotel/selectHotel" import { IconName } from "@/types/components/icon" export default function Parking({ parking }: ParkingProps) { diff --git a/components/SidePeeks/HotelSidePeek/Accordions/Restaurant.tsx b/components/SidePeeks/HotelSidePeek/Accordions/Restaurant.tsx index d35a30304..aaf605a4f 100644 --- a/components/SidePeeks/HotelSidePeek/Accordions/Restaurant.tsx +++ b/components/SidePeeks/HotelSidePeek/Accordions/Restaurant.tsx @@ -3,7 +3,7 @@ import { useIntl } from "react-intl" import AccordionItem from "@/components/TempDesignSystem/Accordion/AccordionItem" import Body from "@/components/TempDesignSystem/Text/Body" -import { RestaurantProps } from "@/types/components/hotelReservation/selectHotel/selectHotel" +import type { RestaurantProps } from "@/types/components/hotelReservation/selectHotel/selectHotel" import { IconName } from "@/types/components/icon" export default function Restaurant({ diff --git a/components/SidePeeks/RoomSidePeek/bedIcon.ts b/components/SidePeeks/RoomSidePeek/bedIcon.ts index 389045159..f58aaabba 100644 --- a/components/SidePeeks/RoomSidePeek/bedIcon.ts +++ b/components/SidePeeks/RoomSidePeek/bedIcon.ts @@ -1,11 +1,11 @@ -import { FC } from "react" - import { BedDoubleIcon, BedSingleIcon, KingBedSmallIcon, } from "@/components/Icons" +import type { FC } from "react" + import type { IconProps } from "@/types/components/icon" export function getBedIcon(name: string): FC | null { diff --git a/components/SidePeeks/RoomSidePeek/facilityIcon.ts b/components/SidePeeks/RoomSidePeek/facilityIcon.ts index f86329504..ada8b97c7 100644 --- a/components/SidePeeks/RoomSidePeek/facilityIcon.ts +++ b/components/SidePeeks/RoomSidePeek/facilityIcon.ts @@ -1,5 +1,3 @@ -import { FC } from "react" - import { AcIcon, AirplaneIcon, @@ -65,7 +63,9 @@ import { YardIcon, } from "@/components/Icons" -import { IconProps } from "@/types/components/icon" +import type { FC } from "react" + +import type { IconProps } from "@/types/components/icon" export function getFacilityIcon( name: string | undefined diff --git a/components/SitewideAlert/Client.tsx b/components/SitewideAlert/Client.tsx index 613a1e18b..37378754a 100644 --- a/components/SitewideAlert/Client.tsx +++ b/components/SitewideAlert/Client.tsx @@ -7,11 +7,10 @@ import { StickyElementNameEnum } from "@/stores/sticky-position" import Alert from "@/components/TempDesignSystem/Alert" import useStickyPosition from "@/hooks/useStickyPosition" -import { SitewideAlertProps } from "./sitewideAlert" - import styles from "./sitewideAlert.module.css" import { AlertTypeEnum } from "@/types/enums/alert" +import type { SitewideAlertProps } from "./sitewideAlert" export default function SiteWideAlertClient({ alert }: SitewideAlertProps) { const alertRef = useRef(null) diff --git a/components/TempDesignSystem/Accordion/AccordionItem/accordionItem.ts b/components/TempDesignSystem/Accordion/AccordionItem/accordionItem.ts index 8f4ff07ca..6e0a4a827 100644 --- a/components/TempDesignSystem/Accordion/AccordionItem/accordionItem.ts +++ b/components/TempDesignSystem/Accordion/AccordionItem/accordionItem.ts @@ -1,8 +1,7 @@ -import { VariantProps } from "class-variance-authority" - -import { accordionItemVariants } from "./variants" +import type { VariantProps } from "class-variance-authority" import type { IconName } from "@/types/components/icon" +import type { accordionItemVariants } from "./variants" export interface AccordionItemProps extends React.HtmlHTMLAttributes, diff --git a/components/TempDesignSystem/Accordion/accordion.ts b/components/TempDesignSystem/Accordion/accordion.ts index fa0ade85c..1d2417512 100644 --- a/components/TempDesignSystem/Accordion/accordion.ts +++ b/components/TempDesignSystem/Accordion/accordion.ts @@ -1,6 +1,6 @@ -import { VariantProps } from "class-variance-authority" +import type { VariantProps } from "class-variance-authority" -import { accordionVariants } from "./variants" +import type { accordionVariants } from "./variants" export interface AccordionProps extends React.HtmlHTMLAttributes, diff --git a/components/TempDesignSystem/Accordion/index.tsx b/components/TempDesignSystem/Accordion/index.tsx index 822026e53..8f4c6ec45 100644 --- a/components/TempDesignSystem/Accordion/index.tsx +++ b/components/TempDesignSystem/Accordion/index.tsx @@ -1,9 +1,9 @@ import { Children, cloneElement, isValidElement } from "react" -import { AccordionItemProps } from "./AccordionItem/accordionItem" import { accordionVariants } from "./variants" import type { AccordionProps } from "./accordion" +import type { AccordionItemProps } from "./AccordionItem/accordionItem" export default function Accordion({ children, diff --git a/components/TempDesignSystem/Alert/alert.ts b/components/TempDesignSystem/Alert/alert.ts index e63873c66..cbced8df2 100644 --- a/components/TempDesignSystem/Alert/alert.ts +++ b/components/TempDesignSystem/Alert/alert.ts @@ -1,9 +1,8 @@ -import { alertVariants } from "./variants" - import type { VariantProps } from "class-variance-authority" -import { AlertTypeEnum } from "@/types/enums/alert" +import type { AlertTypeEnum } from "@/types/enums/alert" import type { SidepeekContent } from "@/types/trpc/routers/contentstack/siteConfig" +import type { alertVariants } from "./variants" export interface AlertProps extends VariantProps { className?: string diff --git a/components/TempDesignSystem/Button/button.ts b/components/TempDesignSystem/Button/button.ts index 618ff8caa..d777ca270 100644 --- a/components/TempDesignSystem/Button/button.ts +++ b/components/TempDesignSystem/Button/button.ts @@ -1,8 +1,8 @@ -import { buttonVariants } from "./variants" - import type { VariantProps } from "class-variance-authority" import type { ButtonProps as ReactAriaButtonProps } from "react-aria-components" +import type { buttonVariants } from "./variants" + export interface ButtonPropsRAC extends Omit, VariantProps { diff --git a/components/TempDesignSystem/Card/card.ts b/components/TempDesignSystem/Card/card.ts index ac2bc66af..a4190b096 100644 --- a/components/TempDesignSystem/Card/card.ts +++ b/components/TempDesignSystem/Card/card.ts @@ -1,9 +1,8 @@ -import { cardVariants } from "./variants" - import type { VariantProps } from "class-variance-authority" import type { ApiImage } from "@/types/components/image" import type { ImageVaultAsset } from "@/types/components/imageVault" +import type { cardVariants } from "./variants" export interface CardProps extends React.HTMLAttributes, diff --git a/components/TempDesignSystem/Card/utils.ts b/components/TempDesignSystem/Card/utils.ts index d796b3f69..0c75c443a 100644 --- a/components/TempDesignSystem/Card/utils.ts +++ b/components/TempDesignSystem/Card/utils.ts @@ -1,11 +1,10 @@ -import { biroScriptVariants } from "@/components/TempDesignSystem/Text/BiroScript/variants" -import { bodyVariants } from "@/components/TempDesignSystem/Text/Body/variants" -import { headingVariants } from "@/components/TempDesignSystem/Text/Title/variants" - import type { VariantProps } from "class-variance-authority" import type { ButtonProps } from "@/components/TempDesignSystem/Button/button" import type { CardProps } from "@/components/TempDesignSystem/Card/card" +import type { biroScriptVariants } from "@/components/TempDesignSystem/Text/BiroScript/variants" +import type { bodyVariants } from "@/components/TempDesignSystem/Text/Body/variants" +import type { headingVariants } from "@/components/TempDesignSystem/Text/Title/variants" export function getTitleFontColor( theme: CardProps["theme"] diff --git a/components/TempDesignSystem/Chip/chip.ts b/components/TempDesignSystem/Chip/chip.ts index cddda0a74..f04012b44 100644 --- a/components/TempDesignSystem/Chip/chip.ts +++ b/components/TempDesignSystem/Chip/chip.ts @@ -1,7 +1,7 @@ -import { chipVariants } from "./variants" - import type { VariantProps } from "class-variance-authority" +import type { chipVariants } from "./variants" + export interface ChipProps extends React.HtmlHTMLAttributes, VariantProps {} diff --git a/components/TempDesignSystem/Divider/divider.ts b/components/TempDesignSystem/Divider/divider.ts index 0f98e5aa7..997a455cf 100644 --- a/components/TempDesignSystem/Divider/divider.ts +++ b/components/TempDesignSystem/Divider/divider.ts @@ -1,7 +1,7 @@ -import { dividerVariants } from "./variants" - import type { VariantProps } from "class-variance-authority" +import type { dividerVariants } from "./variants" + export interface DividerProps extends Omit, "color">, VariantProps {} diff --git a/components/TempDesignSystem/Form/Checkbox/index.tsx b/components/TempDesignSystem/Form/Checkbox/index.tsx index bd4639e39..16b75a275 100644 --- a/components/TempDesignSystem/Form/Checkbox/index.tsx +++ b/components/TempDesignSystem/Form/Checkbox/index.tsx @@ -9,7 +9,7 @@ import Caption from "@/components/TempDesignSystem/Text/Caption" import styles from "./checkbox.module.css" -import { CheckboxProps } from "@/types/components/checkbox" +import type { CheckboxProps } from "@/types/components/checkbox" export default function Checkbox({ className, diff --git a/components/TempDesignSystem/Form/Date/index.tsx b/components/TempDesignSystem/Form/Date/index.tsx index ea1d5e672..b7849c472 100644 --- a/components/TempDesignSystem/Form/Date/index.tsx +++ b/components/TempDesignSystem/Form/Date/index.tsx @@ -1,7 +1,7 @@ "use client" import { parseDate } from "@internationalized/date" import { useEffect } from "react" -import { DateInput, DatePicker, Group } from "react-aria-components" +import { DateInput, DatePicker, Group, type Key } from "react-aria-components" import { useController, useFormContext, useWatch } from "react-hook-form" import { useIntl } from "react-intl" @@ -13,14 +13,10 @@ import { getLocalizedMonthName } from "@/utils/dateFormatting" import { rangeArray } from "@/utils/rangeArray" import ErrorMessage from "../ErrorMessage" -import { DateName } from "./date" +import { DateName, type DateProps } from "./date" import styles from "./date.module.css" -import type { Key } from "react-aria-components" - -import type { DateProps } from "./date" - export default function DateSelect({ name, registerOptions = {} }: DateProps) { const intl = useIntl() const { control, setValue, formState, watch } = useFormContext() diff --git a/components/TempDesignSystem/Form/FilterChip/_Chip/index.tsx b/components/TempDesignSystem/Form/FilterChip/_Chip/index.tsx index 12992bbc4..a17854464 100644 --- a/components/TempDesignSystem/Form/FilterChip/_Chip/index.tsx +++ b/components/TempDesignSystem/Form/FilterChip/_Chip/index.tsx @@ -6,7 +6,7 @@ import Caption from "@/components/TempDesignSystem/Text/Caption" import styles from "./chip.module.css" -import { FilterChipProps } from "@/types/components/form/filterChip" +import type { FilterChipProps } from "@/types/components/form/filterChip" export default function FilterChip({ Icon = HeartIcon, diff --git a/components/TempDesignSystem/Form/Label/label.ts b/components/TempDesignSystem/Form/Label/label.ts index d800294a9..3dbd87e16 100644 --- a/components/TempDesignSystem/Form/Label/label.ts +++ b/components/TempDesignSystem/Form/Label/label.ts @@ -1,7 +1,7 @@ -import { labelVariants } from "./variants" - import type { VariantProps } from "class-variance-authority" +import type { labelVariants } from "./variants" + export interface LabelProps extends React.PropsWithChildren>, VariantProps { diff --git a/components/TempDesignSystem/Form/NewPassword/index.tsx b/components/TempDesignSystem/Form/NewPassword/index.tsx index 818f41492..f7c5d4c22 100644 --- a/components/TempDesignSystem/Form/NewPassword/index.tsx +++ b/components/TempDesignSystem/Form/NewPassword/index.tsx @@ -17,11 +17,11 @@ import Caption from "@/components/TempDesignSystem/Text/Caption" import { passwordValidators } from "@/utils/passwordValidator" import Button from "../../Button" -import { IconProps, type NewPasswordProps } from "./newPassword" +import { type IconProps, type NewPasswordProps } from "./newPassword" import styles from "./newPassword.module.css" -import { PasswordValidatorKey } from "@/types/components/form/newPassword" +import type { PasswordValidatorKey } from "@/types/components/form/newPassword" export default function NewPassword({ name = "newPassword", diff --git a/components/TempDesignSystem/Form/Phone/index.tsx b/components/TempDesignSystem/Form/Phone/index.tsx index cdd26af62..7c5b72896 100644 --- a/components/TempDesignSystem/Form/Phone/index.tsx +++ b/components/TempDesignSystem/Form/Phone/index.tsx @@ -7,13 +7,11 @@ import { useController, useFormContext, useWatch } from "react-hook-form" import { CountrySelector, DialCodePreview, - ParsedCountry, + type ParsedCountry, usePhoneInput, } from "react-international-phone" import { useIntl } from "react-intl" -import { Lang } from "@/constants/languages" - import { ChevronDownIcon } from "@/components/Icons" import ErrorMessage from "@/components/TempDesignSystem/Form/ErrorMessage" import AriaInputWithLabel from "@/components/TempDesignSystem/Form/Input/AriaInputWithLabel" @@ -29,6 +27,7 @@ import type { LowerCaseCountryCode, PhoneProps, } from "@/types/components/form/phone" +import type { Lang } from "@/constants/languages" export default function Phone({ ariaLabel = "Phone number input", diff --git a/components/TempDesignSystem/Grids/Dynamic/Item/item.ts b/components/TempDesignSystem/Grids/Dynamic/Item/item.ts index 58d9b561f..658cc4e0c 100644 --- a/components/TempDesignSystem/Grids/Dynamic/Item/item.ts +++ b/components/TempDesignSystem/Grids/Dynamic/Item/item.ts @@ -1,7 +1,7 @@ -import { itemVariants } from "./variants" - import type { VariantProps } from "class-variance-authority" +import type { itemVariants } from "./variants" + export interface ItemProps extends React.HTMLAttributes, VariantProps {} diff --git a/components/TempDesignSystem/Grids/Stackable/index.tsx b/components/TempDesignSystem/Grids/Stackable/index.tsx index 34aea6f61..1f1c9d58a 100644 --- a/components/TempDesignSystem/Grids/Stackable/index.tsx +++ b/components/TempDesignSystem/Grids/Stackable/index.tsx @@ -1,6 +1,7 @@ -import { StackableGridProps } from "./stackable" import { stackableGridVariants } from "./variants" +import type { StackableGridProps } from "./stackable" + export default function Stackable({ children, className, diff --git a/components/TempDesignSystem/Grids/Stackable/stackable.ts b/components/TempDesignSystem/Grids/Stackable/stackable.ts index 293197e26..7fd72964c 100644 --- a/components/TempDesignSystem/Grids/Stackable/stackable.ts +++ b/components/TempDesignSystem/Grids/Stackable/stackable.ts @@ -1,7 +1,7 @@ -import { stackableGridVariants } from "./variants" - import type { VariantProps } from "class-variance-authority" +import type { stackableGridVariants } from "./variants" + export interface StackableGridProps extends React.HTMLAttributes, VariantProps {} diff --git a/components/TempDesignSystem/Link/link.ts b/components/TempDesignSystem/Link/link.ts index a68362457..aec02ff3b 100644 --- a/components/TempDesignSystem/Link/link.ts +++ b/components/TempDesignSystem/Link/link.ts @@ -1,7 +1,7 @@ -import { linkVariants } from "./variants" - import type { VariantProps } from "class-variance-authority" +import type { linkVariants } from "./variants" + export interface LinkProps extends Omit, "color">, VariantProps { diff --git a/components/TempDesignSystem/LoyaltyCard/loyaltyCard.ts b/components/TempDesignSystem/LoyaltyCard/loyaltyCard.ts index 45100d39e..e1aa2124f 100644 --- a/components/TempDesignSystem/LoyaltyCard/loyaltyCard.ts +++ b/components/TempDesignSystem/LoyaltyCard/loyaltyCard.ts @@ -1,8 +1,7 @@ -import { loyaltyCardVariants } from "./variants" - import type { VariantProps } from "class-variance-authority" -import { ImageVaultAsset } from "@/types/components/imageVault" +import type { ImageVaultAsset } from "@/types/components/imageVault" +import type { loyaltyCardVariants } from "./variants" export interface LoyaltyCardProps extends React.HTMLAttributes, diff --git a/components/TempDesignSystem/Popover/index.tsx b/components/TempDesignSystem/Popover/index.tsx index b1b03f340..2713e6a70 100644 --- a/components/TempDesignSystem/Popover/index.tsx +++ b/components/TempDesignSystem/Popover/index.tsx @@ -10,10 +10,11 @@ import { CloseLargeIcon } from "@/components/Icons" import useSetOverFlowVisibleOnRA from "@/hooks/useSetOverflowVisibleOnRA" import { Arrow } from "./Arrow" -import { PopoverProps } from "./popover" import styles from "./popover.module.css" +import type { PopoverProps } from "./popover" + export default function Popover({ triggerContent, children, diff --git a/components/TempDesignSystem/ShowMoreButton/showMoreButton.ts b/components/TempDesignSystem/ShowMoreButton/showMoreButton.ts index 1b7d66b07..34d8bca82 100644 --- a/components/TempDesignSystem/ShowMoreButton/showMoreButton.ts +++ b/components/TempDesignSystem/ShowMoreButton/showMoreButton.ts @@ -1,7 +1,7 @@ -import { showMoreButtonVariants } from "./variants" - import type { VariantProps } from "class-variance-authority" +import type { showMoreButtonVariants } from "./variants" + export interface ShowMoreButtonProps extends React.PropsWithChildren>, VariantProps { diff --git a/components/TempDesignSystem/Table/table.ts b/components/TempDesignSystem/Table/table.ts index f2759484d..a25c6b1f1 100644 --- a/components/TempDesignSystem/Table/table.ts +++ b/components/TempDesignSystem/Table/table.ts @@ -1,7 +1,7 @@ -import { tableVariants } from "./variants" - import type { VariantProps } from "class-variance-authority" +import type { tableVariants } from "./variants" + export interface TableProps extends React.PropsWithChildren>, VariantProps { diff --git a/components/TempDesignSystem/Text/BiroScript/biroScript.ts b/components/TempDesignSystem/Text/BiroScript/biroScript.ts index 89295b976..aaa0044a5 100644 --- a/components/TempDesignSystem/Text/BiroScript/biroScript.ts +++ b/components/TempDesignSystem/Text/BiroScript/biroScript.ts @@ -1,7 +1,7 @@ -import { biroScriptVariants } from "./variants" - import type { VariantProps } from "class-variance-authority" +import type { biroScriptVariants } from "./variants" + export interface BiroScriptProps extends Omit, "color">, VariantProps { diff --git a/components/TempDesignSystem/Text/Body/body.ts b/components/TempDesignSystem/Text/Body/body.ts index a0261fa05..e84ef73b3 100644 --- a/components/TempDesignSystem/Text/Body/body.ts +++ b/components/TempDesignSystem/Text/Body/body.ts @@ -1,10 +1,10 @@ -import { bodyVariants } from "./variants" - import type { VariantProps } from "class-variance-authority" +import type { bodyVariants } from "./variants" + export interface BodyProps extends Omit, "color">, - VariantProps { + VariantProps { asChild?: boolean fontOnly?: boolean } diff --git a/components/TempDesignSystem/Text/Caption/caption.ts b/components/TempDesignSystem/Text/Caption/caption.ts index b74c05d5a..1a7272417 100644 --- a/components/TempDesignSystem/Text/Caption/caption.ts +++ b/components/TempDesignSystem/Text/Caption/caption.ts @@ -1,10 +1,10 @@ -import { captionVariants } from "./variants" - import type { VariantProps } from "class-variance-authority" +import type { captionVariants } from "./variants" + export interface CaptionProps extends Omit, "color">, - VariantProps { + VariantProps { asChild?: boolean fontOnly?: boolean } diff --git a/components/TempDesignSystem/Text/Footnote/footnote.ts b/components/TempDesignSystem/Text/Footnote/footnote.ts index bf59ff1ef..4eb35721d 100644 --- a/components/TempDesignSystem/Text/Footnote/footnote.ts +++ b/components/TempDesignSystem/Text/Footnote/footnote.ts @@ -1,10 +1,10 @@ -import { footnoteVariants } from "./variants" - import type { VariantProps } from "class-variance-authority" +import type { footnoteVariants } from "./variants" + export interface FootnoteProps extends Omit, "color">, - VariantProps { + VariantProps { asChild?: boolean fontOnly?: boolean } diff --git a/components/TempDesignSystem/Text/Preamble/preamble.ts b/components/TempDesignSystem/Text/Preamble/preamble.ts index 7a8fd27f2..987ba5749 100644 --- a/components/TempDesignSystem/Text/Preamble/preamble.ts +++ b/components/TempDesignSystem/Text/Preamble/preamble.ts @@ -1,7 +1,7 @@ -import { preambleVariants } from "./variants" - import type { VariantProps } from "class-variance-authority" +import type { preambleVariants } from "./variants" + export interface CaptionProps extends Omit, "color">, VariantProps { diff --git a/components/TempDesignSystem/Text/Subtitle/subtitle.ts b/components/TempDesignSystem/Text/Subtitle/subtitle.ts index 61938c750..9c87b1c98 100644 --- a/components/TempDesignSystem/Text/Subtitle/subtitle.ts +++ b/components/TempDesignSystem/Text/Subtitle/subtitle.ts @@ -1,7 +1,7 @@ -import { subtitleVariants } from "./variants" - import type { VariantProps } from "class-variance-authority" +import type { subtitleVariants } from "./variants" + export interface SubtitleProps extends Omit, "color">, VariantProps { diff --git a/components/TempDesignSystem/Text/Title/title.ts b/components/TempDesignSystem/Text/Title/title.ts index ce7789263..37d32376e 100644 --- a/components/TempDesignSystem/Text/Title/title.ts +++ b/components/TempDesignSystem/Text/Title/title.ts @@ -1,7 +1,7 @@ -import { headingVariants } from "./variants" - import type { VariantProps } from "class-variance-authority" +import type { headingVariants } from "./variants" + type HeadingLevel = "h1" | "h2" | "h3" | "h4" | "h5" export interface HeadingProps diff --git a/components/TempDesignSystem/Toasts/index.tsx b/components/TempDesignSystem/Toasts/index.tsx index 899b97672..daa555dbe 100644 --- a/components/TempDesignSystem/Toasts/index.tsx +++ b/components/TempDesignSystem/Toasts/index.tsx @@ -1,4 +1,4 @@ -import { ExternalToast, toast as sonnerToast, Toaster } from "sonner" +import { type ExternalToast, toast as sonnerToast, Toaster } from "sonner" import { CheckCircleIcon, @@ -10,11 +10,12 @@ import { import Button from "../Button" import Body from "../Text/Body" -import { ToastsProps } from "./toasts" import { toastVariants } from "./variants" import styles from "./toasts.module.css" +import type { ToastsProps } from "./toasts" + export function ToastHandler() { return } diff --git a/components/TempDesignSystem/Toasts/toasts.ts b/components/TempDesignSystem/Toasts/toasts.ts index 1bf37d114..b18aedbad 100644 --- a/components/TempDesignSystem/Toasts/toasts.ts +++ b/components/TempDesignSystem/Toasts/toasts.ts @@ -1,7 +1,7 @@ -import { toastVariants } from "./variants" - import type { VariantProps } from "class-variance-authority" +import type { toastVariants } from "./variants" + export type ToastsProps = Omit, "color"> & VariantProps & { onClose?: () => void diff --git a/components/TempDesignSystem/Tooltip/index.tsx b/components/TempDesignSystem/Tooltip/index.tsx index 855bd1237..a2b4ad5d7 100644 --- a/components/TempDesignSystem/Tooltip/index.tsx +++ b/components/TempDesignSystem/Tooltip/index.tsx @@ -1,4 +1,4 @@ -import { PropsWithChildren, useState } from "react" +import { type PropsWithChildren, useState } from "react" import Caption from "@/components/TempDesignSystem/Text/Caption" @@ -6,7 +6,7 @@ import { tooltipVariants } from "./variants" import styles from "./tooltip.module.css" -import { TooltipPosition, TooltipProps } from "@/types/components/tooltip" +import type { TooltipPosition, TooltipProps } from "@/types/components/tooltip" export function Tooltip

({ heading, diff --git a/components/TrackingSDK/Client.tsx b/components/TrackingSDK/Client.tsx index 37933ba96..a009dd4e1 100644 --- a/components/TrackingSDK/Client.tsx +++ b/components/TrackingSDK/Client.tsx @@ -8,7 +8,7 @@ import useTrackingStore from "@/stores/tracking" import { createSDKPageObject } from "@/utils/tracking" -import { TrackingSDKProps } from "@/types/components/tracking" +import type { TrackingSDKProps } from "@/types/components/tracking" export default function TrackingSDK({ pageData, userData }: TrackingSDKProps) { const pathName = usePathname() diff --git a/components/TrackingSDK/RouterTransition.tsx b/components/TrackingSDK/RouterTransition.tsx index cb2597c20..d09014d55 100644 --- a/components/TrackingSDK/RouterTransition.tsx +++ b/components/TrackingSDK/RouterTransition.tsx @@ -7,7 +7,7 @@ import useRouterTransitionStore from "@/stores/router-transition" import { createSDKPageObject } from "@/utils/tracking" -import { TrackingSDKProps } from "@/types/components/tracking" +import type { TrackingSDKProps } from "@/types/components/tracking" enum TransitionStatusEnum { NotRun = "NotRun", diff --git a/components/TrackingSDK/index.tsx b/components/TrackingSDK/index.tsx index 05fd93d9c..b92209ba5 100644 --- a/components/TrackingSDK/index.tsx +++ b/components/TrackingSDK/index.tsx @@ -1,11 +1,10 @@ import { getUserTracking } from "@/lib/trpc/memoizedRequests" -import { serverClient } from "@/lib/trpc/server" import RouterTransition from "@/components/TrackingSDK/RouterTransition" import TrackingSDKClient from "./Client" -import { TrackingSDKPageData } from "@/types/components/tracking" +import type { TrackingSDKPageData } from "@/types/components/tracking" export const preloadUserTracking = () => { void getUserTracking() diff --git a/lib/graphql/_request.ts b/lib/graphql/_request.ts index e2ffef5c4..cd1456ee1 100644 --- a/lib/graphql/_request.ts +++ b/lib/graphql/_request.ts @@ -1,6 +1,6 @@ import "server-only" -import { ClientError, GraphQLClient } from "graphql-request" +import { ClientError, type GraphQLClient } from "graphql-request" import { Lang } from "@/constants/languages" import { env } from "@/env/server" diff --git a/lib/graphql/edgeRequest.ts b/lib/graphql/edgeRequest.ts index 233ec9f93..12aef10d4 100644 --- a/lib/graphql/edgeRequest.ts +++ b/lib/graphql/edgeRequest.ts @@ -1,11 +1,12 @@ -import { DocumentNode } from "graphql" import { GraphQLClient } from "graphql-request" import { env } from "@/env/server" import { request as _request } from "./_request" -import { Data } from "@/types/request" +import type { DocumentNode } from "graphql" + +import type { Data } from "@/types/request" export async function edgeRequest( query: string | DocumentNode, diff --git a/lib/graphql/request.ts b/lib/graphql/request.ts index eb1314e38..de4bc0bc0 100644 --- a/lib/graphql/request.ts +++ b/lib/graphql/request.ts @@ -1,5 +1,4 @@ import fetchRetry from "fetch-retry" -import { DocumentNode } from "graphql" import { GraphQLClient } from "graphql-request" import { cache } from "react" @@ -8,7 +7,9 @@ import { getPreviewHash, isPreviewByUid } from "@/lib/previewContext" import { request as _request } from "./_request" -import { Data } from "@/types/request" +import type { DocumentNode } from "graphql" + +import type { Data } from "@/types/request" export async function request( query: string | DocumentNode, diff --git a/lib/trpc/Provider.tsx b/lib/trpc/Provider.tsx index 90466a831..8f30e734a 100644 --- a/lib/trpc/Provider.tsx +++ b/lib/trpc/Provider.tsx @@ -6,7 +6,6 @@ import { QueryClientProvider, } from "@tanstack/react-query" import { httpBatchLink, loggerLink, TRPCClientError } from "@trpc/client" -import { AnyTRPCRouter } from "@trpc/server" import { useState } from "react" import { login } from "@/constants/routes/handleAuth" @@ -18,6 +17,8 @@ import useLang from "@/hooks/useLang" import { trpc } from "./client" +import type { AnyTRPCRouter } from "@trpc/server" + function initializeTrpcClient() { // Locally we set nextjs to run on port to 3000 so that we always guarantee // that trpc and next are running on the same port. diff --git a/lib/trpc/client.ts b/lib/trpc/client.ts index 46d50e91a..c36594c58 100644 --- a/lib/trpc/client.ts +++ b/lib/trpc/client.ts @@ -1,5 +1,6 @@ import { createTRPCReact } from "@trpc/react-query" -import { inferRouterInputs, inferRouterOutputs } from "@trpc/server" + +import type { inferRouterInputs, inferRouterOutputs } from "@trpc/server" import type { AppRouter } from "@/server" diff --git a/lib/trpc/memoizedRequests/index.ts b/lib/trpc/memoizedRequests/index.ts index 2bf35c264..8a84c6d4a 100644 --- a/lib/trpc/memoizedRequests/index.ts +++ b/lib/trpc/memoizedRequests/index.ts @@ -1,5 +1,3 @@ -import { Lang } from "@/constants/languages" - import { cache } from "@/utils/cache" import { serverClient } from "../server" @@ -8,6 +6,7 @@ import type { BreackfastPackagesInput, PackagesInput, } from "@/types/requests/packages" +import type { Lang } from "@/constants/languages" import type { GetRoomsAvailabilityInput, GetSelectedRoomAvailabilityInput, diff --git a/package-lock.json b/package-lock.json index 8fd09c24b..d757ad2fe 100644 --- a/package-lock.json +++ b/package-lock.json @@ -72,6 +72,8 @@ "@types/node": "^20", "@types/react": "^18", "@types/react-dom": "^18", + "@typescript-eslint/eslint-plugin": "^8.17.0", + "@typescript-eslint/parser": "^8.17.0", "cypress": "^13.6.6", "dotenv": "^16.4.5", "eslint": "^8", @@ -6981,27 +6983,60 @@ "@types/node": "*" } }, - "node_modules/@typescript-eslint/parser": { - "version": "6.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.21.0.tgz", - "integrity": "sha512-tbsV1jPne5CkFQCgPBcDOt30ItF7aJoZL997JSF7MhGQqOeT3svWRYxiqlfA5RUdlHN6Fi+EI9bxqbdyAUZjYQ==", + "node_modules/@typescript-eslint/eslint-plugin": { + "version": "8.17.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.17.0.tgz", + "integrity": "sha512-HU1KAdW3Tt8zQkdvNoIijfWDMvdSweFYm4hWh+KwhPstv+sCmWb89hCIP8msFm9N1R/ooh9honpSuvqKWlYy3w==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "6.21.0", - "@typescript-eslint/types": "6.21.0", - "@typescript-eslint/typescript-estree": "6.21.0", - "@typescript-eslint/visitor-keys": "6.21.0", - "debug": "^4.3.4" + "@eslint-community/regexpp": "^4.10.0", + "@typescript-eslint/scope-manager": "8.17.0", + "@typescript-eslint/type-utils": "8.17.0", + "@typescript-eslint/utils": "8.17.0", + "@typescript-eslint/visitor-keys": "8.17.0", + "graphemer": "^1.4.0", + "ignore": "^5.3.1", + "natural-compare": "^1.4.0", + "ts-api-utils": "^1.3.0" }, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^7.0.0 || ^8.0.0" + "@typescript-eslint/parser": "^8.0.0 || ^8.0.0-alpha.0", + "eslint": "^8.57.0 || ^9.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/parser": { + "version": "8.17.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.17.0.tgz", + "integrity": "sha512-Drp39TXuUlD49F7ilHHCG7TTg8IkA+hxCuULdmzWYICxGXvDXmDmWEjJYZQYgf6l/TFfYNE167m7isnc3xlIEg==", + "dev": true, + "dependencies": { + "@typescript-eslint/scope-manager": "8.17.0", + "@typescript-eslint/types": "8.17.0", + "@typescript-eslint/typescript-estree": "8.17.0", + "@typescript-eslint/visitor-keys": "8.17.0", + "debug": "^4.3.4" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0" }, "peerDependenciesMeta": { "typescript": { @@ -7010,29 +7045,56 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "6.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.21.0.tgz", - "integrity": "sha512-OwLUIWZJry80O99zvqXVEioyniJMa+d2GrqpUTqi5/v5D5rOrppJVBPa0yKCblcigC0/aYAzxxqQ1B+DS2RYsg==", + "version": "8.17.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.17.0.tgz", + "integrity": "sha512-/ewp4XjvnxaREtqsZjF4Mfn078RD/9GmiEAtTeLQ7yFdKnqwTOgRMSvFz4et9U5RiJQ15WTGXPLj89zGusvxBg==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.21.0", - "@typescript-eslint/visitor-keys": "6.21.0" + "@typescript-eslint/types": "8.17.0", + "@typescript-eslint/visitor-keys": "8.17.0" }, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" } }, + "node_modules/@typescript-eslint/type-utils": { + "version": "8.17.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.17.0.tgz", + "integrity": "sha512-q38llWJYPd63rRnJ6wY/ZQqIzPrBCkPdpIsaCfkR3Q4t3p6sb422zougfad4TFW9+ElIFLVDzWGiGAfbb/v2qw==", + "dev": true, + "dependencies": { + "@typescript-eslint/typescript-estree": "8.17.0", + "@typescript-eslint/utils": "8.17.0", + "debug": "^4.3.4", + "ts-api-utils": "^1.3.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, "node_modules/@typescript-eslint/types": { - "version": "6.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.21.0.tgz", - "integrity": "sha512-1kFmZ1rOm5epu9NZEZm1kckCDGj5UJEf7P1kliH4LKu/RkwpsfqqGmY2OOcUs18lSlQBKLDYBOGxRVtrMN5lpg==", + "version": "8.17.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.17.0.tgz", + "integrity": "sha512-gY2TVzeve3z6crqh2Ic7Cr+CAv6pfb0Egee7J5UAVWCpVvDI/F71wNfolIim4FE6hT15EbpZFVUj9j5i38jYXA==", "dev": true, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", @@ -7040,22 +7102,22 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "6.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.21.0.tgz", - "integrity": "sha512-6npJTkZcO+y2/kr+z0hc4HwNfrrP4kNYh57ek7yCNlrBjWQ1Y0OS7jiZTkgumrvkX5HkEKXFZkkdFNkaW2wmUQ==", + "version": "8.17.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.17.0.tgz", + "integrity": "sha512-JqkOopc1nRKZpX+opvKqnM3XUlM7LpFMD0lYxTqOTKQfCWAmxw45e3qlOCsEqEB2yuacujivudOFpCnqkBDNMw==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.21.0", - "@typescript-eslint/visitor-keys": "6.21.0", + "@typescript-eslint/types": "8.17.0", + "@typescript-eslint/visitor-keys": "8.17.0", "debug": "^4.3.4", - "globby": "^11.1.0", + "fast-glob": "^3.3.2", "is-glob": "^4.0.3", - "minimatch": "9.0.3", - "semver": "^7.5.4", - "ts-api-utils": "^1.0.1" + "minimatch": "^9.0.4", + "semver": "^7.6.0", + "ts-api-utils": "^1.3.0" }, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", @@ -7077,9 +7139,9 @@ } }, "node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch": { - "version": "9.0.3", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", - "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", "dev": true, "dependencies": { "brace-expansion": "^2.0.1" @@ -7091,21 +7153,60 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/@typescript-eslint/visitor-keys": { - "version": "6.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.21.0.tgz", - "integrity": "sha512-JJtkDduxLi9bivAB+cYOVMtbkqdPOhZ+ZI5LC47MIRrDV4Yn2o+ZnW10Nkmr28xRpSpdJ6Sm42Hjf2+REYXm0A==", + "node_modules/@typescript-eslint/utils": { + "version": "8.17.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.17.0.tgz", + "integrity": "sha512-bQC8BnEkxqG8HBGKwG9wXlZqg37RKSMY7v/X8VEWD8JG2JuTHuNK0VFvMPMUKQcbk6B+tf05k+4AShAEtCtJ/w==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.21.0", - "eslint-visitor-keys": "^3.4.1" + "@eslint-community/eslint-utils": "^4.4.0", + "@typescript-eslint/scope-manager": "8.17.0", + "@typescript-eslint/types": "8.17.0", + "@typescript-eslint/typescript-estree": "8.17.0" }, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/visitor-keys": { + "version": "8.17.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.17.0.tgz", + "integrity": "sha512-1Hm7THLpO6ww5QU6H/Qp+AusUUl+z/CAm3cNZZ0jQvon9yicgO7Rwd+/WWRpMKLYV6p2UvdbR27c86rzCPpreg==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "8.17.0", + "eslint-visitor-keys": "^4.2.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/visitor-keys/node_modules/eslint-visitor-keys": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz", + "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==", + "dev": true, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" } }, "node_modules/@ungap/structured-clone": { @@ -10304,6 +10405,133 @@ } } }, + "node_modules/eslint-config-next/node_modules/@typescript-eslint/parser": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.21.0.tgz", + "integrity": "sha512-tbsV1jPne5CkFQCgPBcDOt30ItF7aJoZL997JSF7MhGQqOeT3svWRYxiqlfA5RUdlHN6Fi+EI9bxqbdyAUZjYQ==", + "dev": true, + "dependencies": { + "@typescript-eslint/scope-manager": "6.21.0", + "@typescript-eslint/types": "6.21.0", + "@typescript-eslint/typescript-estree": "6.21.0", + "@typescript-eslint/visitor-keys": "6.21.0", + "debug": "^4.3.4" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/eslint-config-next/node_modules/@typescript-eslint/scope-manager": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.21.0.tgz", + "integrity": "sha512-OwLUIWZJry80O99zvqXVEioyniJMa+d2GrqpUTqi5/v5D5rOrppJVBPa0yKCblcigC0/aYAzxxqQ1B+DS2RYsg==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "6.21.0", + "@typescript-eslint/visitor-keys": "6.21.0" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/eslint-config-next/node_modules/@typescript-eslint/types": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.21.0.tgz", + "integrity": "sha512-1kFmZ1rOm5epu9NZEZm1kckCDGj5UJEf7P1kliH4LKu/RkwpsfqqGmY2OOcUs18lSlQBKLDYBOGxRVtrMN5lpg==", + "dev": true, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/eslint-config-next/node_modules/@typescript-eslint/typescript-estree": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.21.0.tgz", + "integrity": "sha512-6npJTkZcO+y2/kr+z0hc4HwNfrrP4kNYh57ek7yCNlrBjWQ1Y0OS7jiZTkgumrvkX5HkEKXFZkkdFNkaW2wmUQ==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "6.21.0", + "@typescript-eslint/visitor-keys": "6.21.0", + "debug": "^4.3.4", + "globby": "^11.1.0", + "is-glob": "^4.0.3", + "minimatch": "9.0.3", + "semver": "^7.5.4", + "ts-api-utils": "^1.0.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/eslint-config-next/node_modules/@typescript-eslint/visitor-keys": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.21.0.tgz", + "integrity": "sha512-JJtkDduxLi9bivAB+cYOVMtbkqdPOhZ+ZI5LC47MIRrDV4Yn2o+ZnW10Nkmr28xRpSpdJ6Sm42Hjf2+REYXm0A==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "6.21.0", + "eslint-visitor-keys": "^3.4.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/eslint-config-next/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/eslint-config-next/node_modules/minimatch": { + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", + "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/eslint-import-resolver-node": { "version": "0.3.9", "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.9.tgz", diff --git a/package.json b/package.json index 7e8af1b1e..b3b3e6620 100644 --- a/package.json +++ b/package.json @@ -87,6 +87,8 @@ "@types/node": "^20", "@types/react": "^18", "@types/react-dom": "^18", + "@typescript-eslint/eslint-plugin": "^8.17.0", + "@typescript-eslint/parser": "^8.17.0", "cypress": "^13.6.6", "dotenv": "^16.4.5", "eslint": "^8", diff --git a/types/transitionTypes/rte/node.ts b/types/transitionTypes/rte/node.ts index d43be2344..8dcc45adb 100644 --- a/types/transitionTypes/rte/node.ts +++ b/types/transitionTypes/rte/node.ts @@ -1,5 +1,3 @@ -import { RTETypeEnum } from "./enums" - import type { EmbedByUid } from "../jsontohtml" import type { Attributes, @@ -8,6 +6,7 @@ import type { RTEImageVaultAttrs, RTELinkAttrs, } from "./attrs" +import type { RTETypeEnum } from "./enums" import type { RenderOptions } from "./option" export interface RTEDefaultNode {