From ffd92401e0e572422f95896087f0287627dffdba Mon Sep 17 00:00:00 2001 From: Manuel <30572287+manuel-rw@users.noreply.github.com> Date: Sun, 14 Jan 2024 22:37:43 +0100 Subject: [PATCH] refactor: optimize imports --- .../WidgetsTab/WidgetElementType.tsx | 2 +- .../Wrappers/Category/CategoryEditModal.tsx | 2 +- .../Wrappers/Category/useCategoryActions.tsx | 4 +-- src/config/provider.tsx | 2 +- src/images/undraw_bug_fixing_oc-7-a.svg | 2 +- src/images/undraw_page_not_found_re_e9o6.svg | 3 +- src/images/undraw_secure_login_pdn4.svg | 2 +- src/modules/ModuleTypes.ts | 30 ------------------- src/pages/401.tsx | 18 +++++------ src/pages/404.tsx | 2 +- src/pages/_app.tsx | 7 ++--- src/pages/_error.tsx | 11 +------ src/pages/auth/invite/[inviteId].tsx | 12 +------- src/pages/auth/login.tsx | 13 +------- src/pages/board/[slug]/customize.tsx | 19 ++---------- src/pages/board/index.tsx | 2 -- src/pages/manage/about.tsx | 13 ++------ src/pages/manage/boards/index.tsx | 7 +++-- src/pages/manage/index.tsx | 13 +------- src/pages/manage/tools/swagger.tsx | 2 +- src/pages/manage/users/index.tsx | 9 +----- src/pages/manage/users/invites.tsx | 12 +------- src/pages/user/preferences.tsx | 14 ++------- .../api/routers/invite/invite-router.spec.ts | 4 +-- src/tools/_tests/humanFileSize.spec.ts | 2 +- .../server/images/github-icons-repository.ts | 6 +--- .../images/jsdelivr-icons-repository.ts | 6 +--- .../server/images/local-icons-repository.ts | 6 +--- .../server/images/unpkg-icons-repository.ts | 6 +--- src/tools/server/loginBuilder.ts | 7 +---- src/utils/api.ts | 2 +- src/utils/i18n-zod-resolver.ts | 2 +- tests/pages/auth/login.spec.ts | 3 +- 33 files changed, 49 insertions(+), 196 deletions(-) delete mode 100644 src/modules/ModuleTypes.ts diff --git a/src/components/Dashboard/Modals/SelectElement/Components/WidgetsTab/WidgetElementType.tsx b/src/components/Dashboard/Modals/SelectElement/Components/WidgetsTab/WidgetElementType.tsx index aafbc5858..9b42f4a1b 100644 --- a/src/components/Dashboard/Modals/SelectElement/Components/WidgetsTab/WidgetElementType.tsx +++ b/src/components/Dashboard/Modals/SelectElement/Components/WidgetsTab/WidgetElementType.tsx @@ -29,7 +29,7 @@ export const WidgetElementType = ({ id, image, disabled, widget }: WidgetElement const getLowestWrapper = () => config?.wrappers.sort((a, b) => a.position - b.position)[0]; const handleAddition = async () => { - updateConfig( + await updateConfig( configName, (prev) => ({ ...prev, diff --git a/src/components/Dashboard/Wrappers/Category/CategoryEditModal.tsx b/src/components/Dashboard/Wrappers/Category/CategoryEditModal.tsx index 09c40b3de..c1882c9c8 100644 --- a/src/components/Dashboard/Wrappers/Category/CategoryEditModal.tsx +++ b/src/components/Dashboard/Wrappers/Category/CategoryEditModal.tsx @@ -28,7 +28,7 @@ export const CategoryEditModal = ({ }); const handleSubmit = async (values: FormType) => { - innerProps.onSuccess({ ...innerProps.category, name: values.name }); + await innerProps.onSuccess({ ...innerProps.category, name: values.name }); context.closeModal(id); }; diff --git a/src/components/Dashboard/Wrappers/Category/useCategoryActions.tsx b/src/components/Dashboard/Wrappers/Category/useCategoryActions.tsx index b9481fcbe..e2362eb38 100644 --- a/src/components/Dashboard/Wrappers/Category/useCategoryActions.tsx +++ b/src/components/Dashboard/Wrappers/Category/useCategoryActions.tsx @@ -32,7 +32,7 @@ export const useCategoryActions = (configName: string | undefined, category: Cat }; // Adding category and wrapper and moving other items down - updateConfig( + await updateConfig( configName, (previous) => { const aboveWrappers = previous.wrappers.filter((x) => x.position <= abovePosition); @@ -87,7 +87,7 @@ export const useCategoryActions = (configName: string | undefined, category: Cat }; // Adding category and wrapper and moving other items down - updateConfig( + await updateConfig( configName, (previous) => { const aboveWrappers = previous.wrappers.filter((x) => x.position < belowPosition); diff --git a/src/config/provider.tsx b/src/config/provider.tsx index 746e4c79d..8c0771fe3 100644 --- a/src/config/provider.tsx +++ b/src/config/provider.tsx @@ -1,4 +1,4 @@ -import { ReactNode, createContext, useContext, useEffect, useState } from 'react'; +import { createContext, ReactNode, useContext, useEffect, useState } from 'react'; import { shallow } from 'zustand/shallow'; import { useColorTheme } from '~/tools/color'; import { ConfigType } from '~/types/config'; diff --git a/src/images/undraw_bug_fixing_oc-7-a.svg b/src/images/undraw_bug_fixing_oc-7-a.svg index 3da286cb4..cf3919467 100644 --- a/src/images/undraw_bug_fixing_oc-7-a.svg +++ b/src/images/undraw_bug_fixing_oc-7-a.svg @@ -1 +1 @@ -bug fixing \ No newline at end of file +bug fixing \ No newline at end of file diff --git a/src/images/undraw_page_not_found_re_e9o6.svg b/src/images/undraw_page_not_found_re_e9o6.svg index 4b07e86c9..3a42d9200 100644 --- a/src/images/undraw_page_not_found_re_e9o6.svg +++ b/src/images/undraw_page_not_found_re_e9o6.svg @@ -1 +1,2 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/images/undraw_secure_login_pdn4.svg b/src/images/undraw_secure_login_pdn4.svg index 97c35f957..6f973d982 100644 --- a/src/images/undraw_secure_login_pdn4.svg +++ b/src/images/undraw_secure_login_pdn4.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/modules/ModuleTypes.ts b/src/modules/ModuleTypes.ts deleted file mode 100644 index 0e9857573..000000000 --- a/src/modules/ModuleTypes.ts +++ /dev/null @@ -1,30 +0,0 @@ -// This interface is to be used in all the modules of the project -// Each module should have its own interface and call the following function: -// TODO: Add a function to register a module -import { Icon } from '@tabler/icons-react'; - -// Note: Maybe use context to keep track of the modules -// TODO: Remove this old component and the entire file -export type IModule = { - id: string; - title: string; - icon: Icon; - component: React.ComponentType; - options?: Option; - padding?: PaddingOptions; -}; - -interface PaddingOptions { - top: number; - right: number; -} - -interface Option { - [x: string]: OptionValues; -} - -export interface OptionValues { - name: string; - value: boolean | string | string[]; - options?: string[]; -} diff --git a/src/pages/401.tsx b/src/pages/401.tsx index e9bf268bb..17b4042f4 100644 --- a/src/pages/401.tsx +++ b/src/pages/401.tsx @@ -1,14 +1,14 @@ -import { Button, Center, Stack, Title, Text, createStyles } from "@mantine/core"; -import { useTranslation } from "next-i18next"; -import Image from "next/image"; -import Head from "next/head"; -import { MainLayout } from "~/components/layout/Templates/MainLayout"; -import Link from "next/link"; +import { Button, Center, createStyles, Stack, Text, Title } from '@mantine/core'; +import { useTranslation } from 'next-i18next'; +import Image from 'next/image'; +import Head from 'next/head'; +import { MainLayout } from '~/components/layout/Templates/MainLayout'; +import Link from 'next/link'; import imageAccessDenied from '~/images/undraw_secure_login_pdn4.svg'; -import { pageAccessDeniedNamespaces } from "~/tools/server/translation-namespaces"; -import { getServerSideTranslations } from "~/tools/server/getServerSideTranslations"; -import { GetServerSidePropsContext } from "next"; +import { pageAccessDeniedNamespaces } from '~/tools/server/translation-namespaces'; +import { getServerSideTranslations } from '~/tools/server/getServerSideTranslations'; +import { GetServerSidePropsContext } from 'next'; export default function Custom401() { const { classes } = useStyles(); diff --git a/src/pages/404.tsx b/src/pages/404.tsx index 1fed25830..1605c215b 100644 --- a/src/pages/404.tsx +++ b/src/pages/404.tsx @@ -1,4 +1,4 @@ -import { Button, Center, Stack, Text, Title, createStyles } from '@mantine/core'; +import { Button, Center, createStyles, Stack, Text, Title } from '@mantine/core'; import { GetServerSidePropsContext } from 'next'; import { useTranslation } from 'next-i18next'; import Head from 'next/head'; diff --git a/src/pages/_app.tsx b/src/pages/_app.tsx index 0af2adbeb..a4dd8a3d4 100644 --- a/src/pages/_app.tsx +++ b/src/pages/_app.tsx @@ -10,7 +10,7 @@ import utc from 'dayjs/plugin/utc'; import 'flag-icons/css/flag-icons.min.css'; import { GetServerSidePropsContext } from 'next'; import { Session } from 'next-auth'; -import { SessionProvider, getSession } from 'next-auth/react'; +import { getSession, SessionProvider } from 'next-auth/react'; import { appWithTranslation } from 'next-i18next'; import { AppProps } from 'next/app'; import Script from 'next/script'; @@ -24,10 +24,7 @@ import { modals } from '~/modals'; import { usePackageAttributesStore } from '~/tools/client/zustands/usePackageAttributesStore'; import { ColorTheme } from '~/tools/color'; import { getLanguageByCode } from '~/tools/language'; -import { - ServerSidePackageAttributesType, - getServiceSidePackageAttributes, -} from '~/tools/server/getPackageVersion'; +import { getServiceSidePackageAttributes, ServerSidePackageAttributesType } from '~/tools/server/getPackageVersion'; import { theme } from '~/tools/server/theme/theme'; import { ConfigType } from '~/types/config'; import { api } from '~/utils/api'; diff --git a/src/pages/_error.tsx b/src/pages/_error.tsx index e59138184..c50f94b1f 100644 --- a/src/pages/_error.tsx +++ b/src/pages/_error.tsx @@ -1,13 +1,4 @@ -import { - Accordion, - Center, - Group, - Stack, - Text, - Title, - createStyles, - useMantineTheme, -} from '@mantine/core'; +import { Accordion, Center, createStyles, Group, Stack, Text, Title, useMantineTheme } from '@mantine/core'; import { IconDeviceDesktop, IconInfoCircle, IconServer } from '@tabler/icons-react'; import { NextPageContext } from 'next'; import Head from 'next/head'; diff --git a/src/pages/auth/invite/[inviteId].tsx b/src/pages/auth/invite/[inviteId].tsx index 4d795e5ba..f41bfeb6a 100644 --- a/src/pages/auth/invite/[inviteId].tsx +++ b/src/pages/auth/invite/[inviteId].tsx @@ -1,14 +1,4 @@ -import { - Button, - Card, - Flex, - PasswordInput, - Popover, - Stack, - Text, - TextInput, - Title, -} from '@mantine/core'; +import { Button, Card, Flex, PasswordInput, Stack, Text, TextInput, Title } from '@mantine/core'; import { useForm } from '@mantine/form'; import { showNotification, updateNotification } from '@mantine/notifications'; import { IconCheck, IconX } from '@tabler/icons-react'; diff --git a/src/pages/auth/login.tsx b/src/pages/auth/login.tsx index fe66adc4b..b1dabe22c 100644 --- a/src/pages/auth/login.tsx +++ b/src/pages/auth/login.tsx @@ -1,15 +1,4 @@ -import { - ActionIcon, - Alert, - Button, - Card, - Flex, - PasswordInput, - Stack, - Text, - TextInput, - Title, -} from '@mantine/core'; +import { Alert, Button, Card, Flex, PasswordInput, Stack, Text, TextInput, Title } from '@mantine/core'; import { useForm } from '@mantine/form'; import { IconAlertTriangle } from '@tabler/icons-react'; import { GetServerSideProps, InferGetServerSidePropsType } from 'next'; diff --git a/src/pages/board/[slug]/customize.tsx b/src/pages/board/[slug]/customize.tsx index 5234f9d84..88c0c8e0e 100644 --- a/src/pages/board/[slug]/customize.tsx +++ b/src/pages/board/[slug]/customize.tsx @@ -1,16 +1,4 @@ -import { - Affix, - Button, - Card, - Container, - Group, - Paper, - Stack, - Text, - Title, - Transition, - rem, -} from '@mantine/core'; +import { Affix, Button, Card, Container, Group, Paper, rem, Stack, Text, Title, Transition } from '@mantine/core'; import { showNotification, updateNotification } from '@mantine/notifications'; import { IconArrowLeft, @@ -35,10 +23,7 @@ import { AppearanceCustomization } from '~/components/Board/Customize/Appearance import { GridstackCustomization } from '~/components/Board/Customize/Gridstack/GridstackCustomization'; import { LayoutCustomization } from '~/components/Board/Customize/Layout/LayoutCustomization'; import { PageMetadataCustomization } from '~/components/Board/Customize/PageMetadata/PageMetadataCustomization'; -import { - BoardCustomizationFormProvider, - useBoardCustomizationForm, -} from '~/components/Board/Customize/form'; +import { BoardCustomizationFormProvider, useBoardCustomizationForm } from '~/components/Board/Customize/form'; import { useBoardLink } from '~/components/layout/Templates/BoardLayout'; import { MainLayout } from '~/components/layout/Templates/MainLayout'; import { createTrpcServersideHelpers } from '~/server/api/helper'; diff --git a/src/pages/board/index.tsx b/src/pages/board/index.tsx index 71485b858..0fb684398 100644 --- a/src/pages/board/index.tsx +++ b/src/pages/board/index.tsx @@ -1,5 +1,4 @@ import { GetServerSidePropsContext, InferGetServerSidePropsType } from 'next'; -import { SSRConfig } from 'next-i18next'; import { Dashboard } from '~/components/Dashboard/Dashboard'; import { BoardLayout } from '~/components/layout/Templates/BoardLayout'; import { useInitConfig } from '~/config/init'; @@ -10,7 +9,6 @@ import { getFrontendConfig } from '~/tools/config/getFrontendConfig'; import { getServerSideTranslations } from '~/tools/server/getServerSideTranslations'; import { checkForSessionOrAskForLogin } from '~/tools/server/loginBuilder'; import { boardNamespaces } from '~/tools/server/translation-namespaces'; -import { ConfigType } from '~/types/config'; import { api } from '~/utils/api'; export default function BoardPage({ diff --git a/src/pages/manage/about.tsx b/src/pages/manage/about.tsx index 394e07c92..1ecae4c90 100644 --- a/src/pages/manage/about.tsx +++ b/src/pages/manage/about.tsx @@ -3,6 +3,7 @@ import { ActionIcon, Anchor, Badge, + createStyles, Divider, Group, HoverCard, @@ -10,20 +11,12 @@ import { Stack, Table, Text, - createStyles, } from '@mantine/core'; -import { - IconAnchor, - IconKey, - IconLanguage, - IconSchema, - IconVersions, - IconVocabulary, -} from '@tabler/icons-react'; +import { IconAnchor, IconKey, IconLanguage, IconSchema, IconVersions, IconVocabulary } from '@tabler/icons-react'; import { useQuery } from '@tanstack/react-query'; import { InitOptions } from 'i18next'; import { GetServerSidePropsContext } from 'next'; -import { Trans, i18n, useTranslation } from 'next-i18next'; +import { i18n, Trans, useTranslation } from 'next-i18next'; import Head from 'next/head'; import { ReactNode } from 'react'; import { ManageLayout } from '~/components/layout/Templates/ManageLayout'; diff --git a/src/pages/manage/boards/index.tsx b/src/pages/manage/boards/index.tsx index e7a7a7fd4..52e068dcd 100644 --- a/src/pages/manage/boards/index.tsx +++ b/src/pages/manage/boards/index.tsx @@ -5,7 +5,8 @@ import { Card, Group, LoadingOverlay, - Menu, Modal, + Menu, + Modal, SimpleGrid, Stack, Text, @@ -15,7 +16,8 @@ import { useDisclosure, useListState } from '@mantine/hooks'; import { IconBox, IconCategory, - IconCopy, IconCursorText, + IconCopy, + IconCursorText, IconDeviceFloppy, IconDotsVertical, IconFolderFilled, @@ -40,7 +42,6 @@ import { getServerSideTranslations } from '~/tools/server/getServerSideTranslati import { checkForSessionOrAskForLogin } from '~/tools/server/loginBuilder'; import { manageNamespaces } from '~/tools/server/translation-namespaces'; import { api } from '~/utils/api'; -import { modals } from '@mantine/modals'; import { notifications } from '@mantine/notifications'; import { RenameBoardModal } from '~/components/Dashboard/Modals/RenameBoard/RenameBoardModal'; import { useState } from 'react'; diff --git a/src/pages/manage/index.tsx b/src/pages/manage/index.tsx index 281a7ef8d..9a4019e9b 100644 --- a/src/pages/manage/index.tsx +++ b/src/pages/manage/index.tsx @@ -1,15 +1,4 @@ -import { - Box, - Card, - Group, - Image, - SimpleGrid, - Stack, - Text, - Title, - UnstyledButton, - createStyles, -} from '@mantine/core'; +import { Box, Card, createStyles, Group, Image, SimpleGrid, Stack, Text, Title, UnstyledButton } from '@mantine/core'; import { IconArrowRight } from '@tabler/icons-react'; import { GetServerSideProps } from 'next'; import { useSession } from 'next-auth/react'; diff --git a/src/pages/manage/tools/swagger.tsx b/src/pages/manage/tools/swagger.tsx index b8e7fbb15..c440e2180 100644 --- a/src/pages/manage/tools/swagger.tsx +++ b/src/pages/manage/tools/swagger.tsx @@ -1,4 +1,4 @@ -import { GetServerSidePropsContext, NextPage } from 'next'; +import { GetServerSidePropsContext } from 'next'; import dynamic from 'next/dynamic'; import 'swagger-ui-react/swagger-ui.css'; import React, { useEffect } from 'react'; diff --git a/src/pages/manage/users/index.tsx b/src/pages/manage/users/index.tsx index 6a2d08fad..2f761a845 100644 --- a/src/pages/manage/users/index.tsx +++ b/src/pages/manage/users/index.tsx @@ -15,14 +15,7 @@ import { } from '@mantine/core'; import { useForm, zodResolver } from '@mantine/form'; import { useDebouncedValue } from '@mantine/hooks'; -import { - IconPencil, - IconUser, - IconUserPlus, - IconUserShield, - IconUserStar, - IconX, -} from '@tabler/icons-react'; +import { IconPencil, IconUser, IconUserPlus, IconUserShield, IconUserStar, IconX } from '@tabler/icons-react'; import { GetServerSideProps } from 'next'; import { useTranslation } from 'next-i18next'; import Head from 'next/head'; diff --git a/src/pages/manage/users/invites.tsx b/src/pages/manage/users/invites.tsx index 526524633..d9783810a 100644 --- a/src/pages/manage/users/invites.tsx +++ b/src/pages/manage/users/invites.tsx @@ -1,14 +1,4 @@ -import { - ActionIcon, - Button, - Center, - Flex, - Pagination, - Table, - Text, - Title, - createStyles, -} from '@mantine/core'; +import { ActionIcon, Button, Center, createStyles, Flex, Pagination, Table, Text, Title } from '@mantine/core'; import { modals } from '@mantine/modals'; import { IconPlus, IconTrash } from '@tabler/icons-react'; import dayjs from 'dayjs'; diff --git a/src/pages/user/preferences.tsx b/src/pages/user/preferences.tsx index 85b81532f..d555d15ef 100644 --- a/src/pages/user/preferences.tsx +++ b/src/pages/user/preferences.tsx @@ -1,14 +1,4 @@ -import { - Button, - Container, - Group, - LoadingOverlay, - Paper, - Select, - Stack, - Text, - Title, -} from '@mantine/core'; +import { Button, Container, Group, LoadingOverlay, Paper, Select, Stack, Text, Title } from '@mantine/core'; import { createFormContext } from '@mantine/form'; import { IconArrowLeft } from '@tabler/icons-react'; import { GetServerSideProps } from 'next'; @@ -24,7 +14,7 @@ import { createTrpcServersideHelpers } from '~/server/api/helper'; import { getServerAuthSession } from '~/server/auth'; import { languages } from '~/tools/language'; import { getServerSideTranslations } from '~/tools/server/getServerSideTranslations'; -import { RouterOutputs, api } from '~/utils/api'; +import { api, RouterOutputs } from '~/utils/api'; import { useI18nZodResolver } from '~/utils/i18n-zod-resolver'; import { updateSettingsValidationSchema } from '~/validations/user'; diff --git a/src/server/api/routers/invite/invite-router.spec.ts b/src/server/api/routers/invite/invite-router.spec.ts index 1a72e654e..aaf2620fb 100644 --- a/src/server/api/routers/invite/invite-router.spec.ts +++ b/src/server/api/routers/invite/invite-router.spec.ts @@ -3,11 +3,9 @@ import { eq } from 'drizzle-orm'; import { migrate } from 'drizzle-orm/better-sqlite3/migrator'; import { Session, User } from 'next-auth'; import { v4 } from 'uuid'; -import { afterAll, afterEach, beforeAll, beforeEach, describe, expect, test, vi } from 'vitest'; +import { afterEach, beforeEach, describe, expect, test, vi } from 'vitest'; import { db, sqlite } from '~/server/db'; import { invites, users } from '~/server/db/schema'; - -import { rootRouter } from '../../root'; import { inviteRouter } from './invite-router'; const sessionMock = (user?: Partial): Session => ({ diff --git a/src/tools/_tests/humanFileSize.spec.ts b/src/tools/_tests/humanFileSize.spec.ts index 421642a19..49d5e2d39 100644 --- a/src/tools/_tests/humanFileSize.spec.ts +++ b/src/tools/_tests/humanFileSize.spec.ts @@ -1,4 +1,4 @@ -import { describe, expect, it, vi } from 'vitest'; +import { describe, expect, it } from 'vitest'; import { humanFileSize } from '../humanFileSize'; diff --git a/src/tools/server/images/github-icons-repository.ts b/src/tools/server/images/github-icons-repository.ts index a651d0932..080195cfd 100644 --- a/src/tools/server/images/github-icons-repository.ts +++ b/src/tools/server/images/github-icons-repository.ts @@ -1,8 +1,4 @@ -import { - AbstractIconRepository, - NormalizedIcon, - NormalizedIconRepositoryResult, -} from './abstract-icons-repository'; +import { AbstractIconRepository, NormalizedIcon, NormalizedIconRepositoryResult } from './abstract-icons-repository'; export class GitHubIconsRepository extends AbstractIconRepository { static readonly walkxcode = { diff --git a/src/tools/server/images/jsdelivr-icons-repository.ts b/src/tools/server/images/jsdelivr-icons-repository.ts index 19cf7b164..da9b353a0 100644 --- a/src/tools/server/images/jsdelivr-icons-repository.ts +++ b/src/tools/server/images/jsdelivr-icons-repository.ts @@ -1,8 +1,4 @@ -import { - AbstractIconRepository, - NormalizedIcon, - NormalizedIconRepositoryResult, -} from './abstract-icons-repository'; +import { AbstractIconRepository, NormalizedIcon, NormalizedIconRepositoryResult } from './abstract-icons-repository'; export class JsdelivrIconsRepository extends AbstractIconRepository { static readonly papirusRepository = { diff --git a/src/tools/server/images/local-icons-repository.ts b/src/tools/server/images/local-icons-repository.ts index 3114d32e3..e7f7826c9 100644 --- a/src/tools/server/images/local-icons-repository.ts +++ b/src/tools/server/images/local-icons-repository.ts @@ -1,10 +1,6 @@ import fs from 'fs'; -import { - AbstractIconRepository, - NormalizedIcon, - NormalizedIconRepositoryResult, -} from './abstract-icons-repository'; +import { AbstractIconRepository, NormalizedIcon, NormalizedIconRepositoryResult } from './abstract-icons-repository'; export class LocalIconsRepository extends AbstractIconRepository { constructor() { diff --git a/src/tools/server/images/unpkg-icons-repository.ts b/src/tools/server/images/unpkg-icons-repository.ts index c57e020a4..7838d52eb 100644 --- a/src/tools/server/images/unpkg-icons-repository.ts +++ b/src/tools/server/images/unpkg-icons-repository.ts @@ -1,8 +1,4 @@ -import { - AbstractIconRepository, - NormalizedIcon, - NormalizedIconRepositoryResult, -} from './abstract-icons-repository'; +import { AbstractIconRepository, NormalizedIcon, NormalizedIconRepositoryResult } from './abstract-icons-repository'; export class UnpkgIconsRepository extends AbstractIconRepository { static tablerRepository = 'https://unpkg.com/@tabler/icons-png@2.0.0-beta/icons/'; diff --git a/src/tools/server/loginBuilder.ts b/src/tools/server/loginBuilder.ts index 44b8da848..5ec4b8975 100644 --- a/src/tools/server/loginBuilder.ts +++ b/src/tools/server/loginBuilder.ts @@ -1,9 +1,4 @@ -import { - GetServerSidePropsContext, - GetServerSidePropsResult, - PreviewData, - Redirect -} from 'next'; +import { GetServerSidePropsContext, GetServerSidePropsResult, PreviewData } from 'next'; import { Session } from 'next-auth'; diff --git a/src/utils/api.ts b/src/utils/api.ts index bb3a3b72e..be7f7bc2b 100644 --- a/src/utils/api.ts +++ b/src/utils/api.ts @@ -5,7 +5,7 @@ * We also create a few inference helpers for input and output types. */ import { createTRPCProxyClient, httpBatchLink, loggerLink } from '@trpc/client'; -import { WithTRPCConfig, createTRPCNext } from '@trpc/next'; +import { createTRPCNext } from '@trpc/next'; import { type inferRouterInputs, type inferRouterOutputs } from '@trpc/server'; import superjson from 'superjson'; import { env } from '~/env'; diff --git a/src/utils/i18n-zod-resolver.ts b/src/utils/i18n-zod-resolver.ts index 688124e19..006d74eec 100644 --- a/src/utils/i18n-zod-resolver.ts +++ b/src/utils/i18n-zod-resolver.ts @@ -1,7 +1,7 @@ import { zodResolver } from '@mantine/form'; import { TFunction } from 'i18next'; import { useTranslation } from 'next-i18next'; -import { ErrorMapCtx, ZodIssueCode, ZodSchema, ZodTooBigIssue, ZodTooSmallIssue, z } from 'zod'; +import { ErrorMapCtx, z, ZodIssueCode, ZodSchema, ZodTooBigIssue, ZodTooSmallIssue } from 'zod'; export const useI18nZodResolver = () => { const { t } = useTranslation('zod'); diff --git a/tests/pages/auth/login.spec.ts b/tests/pages/auth/login.spec.ts index c546eabf7..d4facabe3 100644 --- a/tests/pages/auth/login.spec.ts +++ b/tests/pages/auth/login.spec.ts @@ -1,5 +1,4 @@ -import { IncomingMessage } from 'http'; -import { ServerResponse } from 'http'; +import { IncomingMessage, ServerResponse } from 'http'; import { GetServerSidePropsContext } from 'next'; import { SSRConfig } from 'next-i18next'; import { ParsedUrlQuery } from 'querystring';