From 6a7e0d49f6ff61a78a1360507ba79d23109191a9 Mon Sep 17 00:00:00 2001 From: Edmund Hung Date: Tue, 24 May 2022 00:17:37 +0200 Subject: [PATCH] fix: eslint warnings --- app/components/BookmarkDetails.tsx | 3 ++- app/components/CategoryIcon.tsx | 2 +- app/components/ResourcesDetails.tsx | 2 +- app/components/SearchList.tsx | 2 +- app/components/ShowMoreButton.tsx | 2 +- app/components/SidebarNavigation.tsx | 4 ++-- app/config.ts | 2 +- app/helpers.ts | 2 +- app/hooks.ts | 2 +- app/resources.tsx | 2 +- app/routes/__layout.tsx | 2 +- app/routes/__layout/submit.tsx | 2 +- app/search.ts | 2 +- playwright.config.ts | 3 ++- tests/setup.ts | 6 ++---- worker/store/PageStore.ts | 2 +- 16 files changed, 20 insertions(+), 20 deletions(-) diff --git a/app/components/BookmarkDetails.tsx b/app/components/BookmarkDetails.tsx index 1831416..2b995e6 100644 --- a/app/components/BookmarkDetails.tsx +++ b/app/components/BookmarkDetails.tsx @@ -1,4 +1,5 @@ -import { ReactElement, useMemo } from 'react'; +import type { ReactElement } from 'react'; +import { useMemo } from 'react'; import { useLocation } from '@remix-run/react'; import { PaneContainer, PaneHeader, PaneContent, PaneFooter } from '~/layout'; import IconLink from '~/components/IconLink'; diff --git a/app/components/CategoryIcon.tsx b/app/components/CategoryIcon.tsx index 4134790..f5d842a 100644 --- a/app/components/CategoryIcon.tsx +++ b/app/components/CategoryIcon.tsx @@ -1,4 +1,4 @@ -import { ReactElement } from 'react'; +import type { ReactElement } from 'react'; import SvgIcon from '~/components/SvgIcon'; import packageIcon from '~/icons/box-open.svg'; import repositoryIcon from '~/icons/map-signs.svg'; diff --git a/app/components/ResourcesDetails.tsx b/app/components/ResourcesDetails.tsx index 89fe30b..ae863f2 100644 --- a/app/components/ResourcesDetails.tsx +++ b/app/components/ResourcesDetails.tsx @@ -14,7 +14,7 @@ import { } from '~/search'; import { PaneContainer, PaneHeader, PaneFooter, PaneContent } from '~/layout'; import FlashMessage from '~/components/FlashMessage'; -import { User } from '~/types'; +import type { User } from '~/types'; import IconLink from '~/components/IconLink'; import { isAdministrator } from '~/helpers'; import { useLists } from '~/hooks'; diff --git a/app/components/SearchList.tsx b/app/components/SearchList.tsx index 0a597c5..677d0d7 100644 --- a/app/components/SearchList.tsx +++ b/app/components/SearchList.tsx @@ -13,7 +13,7 @@ import { List, PaneFooter, } from '~/layout'; -import { SearchOptions } from '~/types'; +import type { SearchOptions } from '~/types'; interface SearchListProps { searchOptions: SearchOptions; diff --git a/app/components/ShowMoreButton.tsx b/app/components/ShowMoreButton.tsx index 35b2d3b..b2787c4 100644 --- a/app/components/ShowMoreButton.tsx +++ b/app/components/ShowMoreButton.tsx @@ -1,7 +1,7 @@ import { Link } from '@remix-run/react'; import { useInView } from 'react-intersection-observer'; import { getResourceSearchParams } from '~/search'; -import { SearchOptions } from '~/types'; +import type { SearchOptions } from '~/types'; import { useEffect, useMemo, useRef } from 'react'; interface ShowMoreButtonProps { diff --git a/app/components/SidebarNavigation.tsx b/app/components/SidebarNavigation.tsx index 8b09464..18bced7 100644 --- a/app/components/SidebarNavigation.tsx +++ b/app/components/SidebarNavigation.tsx @@ -26,10 +26,10 @@ import { List, } from '~/layout'; import { getResourceURL, getSearchOptions, toggleSearchParams } from '~/search'; -import { SearchOptions } from '~/types'; +import type { SearchOptions } from '~/types'; import IconLink from '~/components/IconLink'; import { isAdministrator, isMaintainer } from '~/helpers'; -import { GuideMetadata } from '../../worker/types'; +import type { GuideMetadata } from '../../worker/types'; interface ExternalLinkProps { href: string; diff --git a/app/config.ts b/app/config.ts index ac436a1..5230508 100644 --- a/app/config.ts +++ b/app/config.ts @@ -1,4 +1,4 @@ -import { Category } from '~/types'; +import type { Category } from '~/types'; export const categories: Category[] = ['package', 'repository', 'others']; diff --git a/app/helpers.ts b/app/helpers.ts index b3d8e40..ce4df89 100644 --- a/app/helpers.ts +++ b/app/helpers.ts @@ -1,5 +1,5 @@ import { administrators, maintainers } from '~/config'; -import { Context } from '~/types'; +import type { Context } from '~/types'; export function notFound(): Response { const statusText = 'Not Found'; diff --git a/app/hooks.ts b/app/hooks.ts index 6627491..e510451 100644 --- a/app/hooks.ts +++ b/app/hooks.ts @@ -1,5 +1,5 @@ import { useMatches } from '@remix-run/react'; -import { GuideMetadata, SessionData } from '~/types'; +import type { GuideMetadata, SessionData } from '~/types'; export function useSessionData(): SessionData { const [rootMatch] = useMatches(); diff --git a/app/resources.tsx b/app/resources.tsx index 35b7116..d3a5adb 100644 --- a/app/resources.tsx +++ b/app/resources.tsx @@ -1,5 +1,5 @@ import { getSite } from '~/search'; -import { SearchOptions, Resource, User } from '~/types'; +import type { SearchOptions, Resource, User } from '~/types'; function calculateScore(resource: Resource): number { const timeScore = diff --git a/app/routes/__layout.tsx b/app/routes/__layout.tsx index ab2446a..cb40b4a 100644 --- a/app/routes/__layout.tsx +++ b/app/routes/__layout.tsx @@ -5,7 +5,7 @@ import { json } from '@remix-run/cloudflare'; import clsx from 'clsx'; import Progress from '~/components/Progress'; import SidebarNavigation from '~/components/SidebarNavigation'; -import { Context } from '~/types'; +import type { Context } from '~/types'; import { useSessionData } from '~/hooks'; export let loader: LoaderFunction = async ({ context }) => { diff --git a/app/routes/__layout/submit.tsx b/app/routes/__layout/submit.tsx index 02b784f..414e11c 100644 --- a/app/routes/__layout/submit.tsx +++ b/app/routes/__layout/submit.tsx @@ -5,7 +5,7 @@ import { useMemo } from 'react'; import menuIcon from '~/icons/menu.svg'; import FlashMessage from '~/components/FlashMessage'; import { PaneContainer, PaneHeader, PaneFooter, PaneContent } from '~/layout'; -import { Context } from '~/types'; +import type { Context } from '~/types'; import { formatMeta, isMaintainer } from '~/helpers'; import { toggleSearchParams } from '~/search'; import IconLink from '~/components/IconLink'; diff --git a/app/search.ts b/app/search.ts index ca4caf2..577d55b 100644 --- a/app/search.ts +++ b/app/search.ts @@ -1,4 +1,4 @@ -import { SearchOptions } from '~/types'; +import type { SearchOptions } from '~/types'; import { platforms } from '~/config'; import { capitalize } from '~/helpers'; diff --git a/playwright.config.ts b/playwright.config.ts index a73fc0e..7a55610 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -1,4 +1,5 @@ -import { PlaywrightTestConfig, devices } from '@playwright/test'; +import type { PlaywrightTestConfig } from '@playwright/test'; +import { devices } from '@playwright/test'; const config: PlaywrightTestConfig = { forbidOnly: !!process.env.CI, diff --git a/tests/setup.ts b/tests/setup.ts index 8301b2c..5096508 100644 --- a/tests/setup.ts +++ b/tests/setup.ts @@ -1,8 +1,6 @@ import { test as base, expect } from '@playwright/test'; -import { - fixtures, - TestingLibraryFixtures, -} from '@playwright-testing-library/test/fixture'; +import type { TestingLibraryFixtures } from '@playwright-testing-library/test/fixture'; +import { fixtures } from '@playwright-testing-library/test/fixture'; import { Miniflare } from 'miniflare'; import { MockAgent, setGlobalDispatcher } from 'undici'; diff --git a/worker/store/PageStore.ts b/worker/store/PageStore.ts index 56cf153..998bf80 100644 --- a/worker/store/PageStore.ts +++ b/worker/store/PageStore.ts @@ -1,5 +1,5 @@ import { scrapeHTML, getPageDetails, checkSafeBrowsingAPI } from '../scraping'; -import { Env, Page, PageMetadata } from '../types'; +import type { Env, Page, PageMetadata } from '../types'; import { configureStore, restoreStoreData } from '../utils'; type PageStatistics = Required>;