From 2a5480da79957c045cfac223d31121c80b5d73c1 Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Sat, 18 Feb 2023 10:40:37 +0100 Subject: [PATCH 1/4] Add import type whenever possible --- src/api/ShlinkApiError.tsx | 2 +- src/api/services/ShlinkApiClient.ts | 8 ++--- src/api/services/ShlinkApiClientBuilder.ts | 7 ++-- src/api/services/provideServices.ts | 2 +- src/api/types/index.ts | 8 ++--- src/api/utils/index.ts | 9 ++--- src/app/App.tsx | 7 ++-- src/app/services/provideServices.ts | 4 +-- src/common/AppUpdateBanner.tsx | 2 +- src/common/AsideMenu.tsx | 10 +++--- src/common/ErrorHandler.tsx | 3 +- src/common/Home.tsx | 2 +- src/common/MainHeader.tsx | 3 +- src/common/MenuLayout.tsx | 5 +-- src/common/NoMenuLayout.tsx | 2 +- src/common/NotFound.tsx | 2 +- src/common/ScrollToTop.tsx | 3 +- src/common/ShlinkVersions.tsx | 3 +- src/common/ShlinkVersionsContainer.tsx | 4 +-- src/common/SimplePaginator.tsx | 5 +-- src/common/services/HttpClient.ts | 2 +- src/common/services/ImageDownloader.ts | 2 +- src/common/services/ReportExporter.ts | 6 ++-- src/common/services/provideServices.ts | 4 +-- src/container/index.ts | 5 +-- src/container/store.ts | 7 ++-- src/container/types.ts | 36 +++++++++---------- src/domains/DomainRow.tsx | 13 +++---- src/domains/DomainSelector.tsx | 5 +-- src/domains/ManageDomains.tsx | 9 ++--- src/domains/data/index.ts | 2 +- src/domains/helpers/DomainDropdown.tsx | 9 ++--- src/domains/helpers/DomainStatusIcon.tsx | 7 ++-- .../helpers/EditDomainRedirectsModal.tsx | 10 +++--- src/domains/reducers/domainRedirects.ts | 4 +-- src/domains/reducers/domainsList.ts | 13 +++---- src/domains/services/provideServices.ts | 4 +-- src/mercure/helpers/boundToMercureHub.tsx | 7 ++-- src/mercure/helpers/index.ts | 2 +- src/mercure/reducers/mercureInfo.ts | 4 +-- src/mercure/services/provideServices.ts | 2 +- src/reducers/index.ts | 4 +-- src/servers/CreateServer.tsx | 10 +++--- src/servers/DeleteServerButton.tsx | 6 ++-- src/servers/DeleteServerModal.tsx | 5 +-- src/servers/EditServer.tsx | 5 +-- src/servers/ManageServers.tsx | 13 +++---- src/servers/ManageServersRow.tsx | 6 ++-- src/servers/ManageServersRowDropdown.tsx | 6 ++-- src/servers/Overview.tsx | 19 +++++----- src/servers/ServersDropdown.tsx | 3 +- src/servers/ServersListGroup.tsx | 4 +-- src/servers/data/index.ts | 2 +- .../helpers/DuplicatedServersModal.tsx | 5 +-- src/servers/helpers/HighlightCard.tsx | 2 +- src/servers/helpers/ImportServersBtn.tsx | 7 ++-- src/servers/helpers/ServerError.tsx | 7 ++-- src/servers/helpers/ServerForm.tsx | 5 +-- src/servers/helpers/withSelectedServer.tsx | 6 ++-- src/servers/helpers/withoutSelectedServer.tsx | 3 +- src/servers/reducers/remoteServers.ts | 5 +-- src/servers/reducers/selectedServer.ts | 10 +++--- src/servers/reducers/servers.ts | 5 +-- src/servers/services/ServersExporter.ts | 7 ++-- src/servers/services/ServersImporter.ts | 4 +-- src/servers/services/provideServices.ts | 4 +-- src/settings/RealTimeUpdatesSettings.tsx | 2 +- src/settings/Settings.tsx | 2 +- src/settings/ShortUrlCreationSettings.tsx | 4 +-- src/settings/ShortUrlsListSettings.tsx | 5 +-- src/settings/TagsSettings.tsx | 4 +-- src/settings/UserInterfaceSettings.tsx | 7 ++-- src/settings/VisitsSettings.tsx | 6 ++-- src/settings/helpers/index.ts | 2 +- src/settings/reducers/settings.ts | 11 +++--- src/settings/services/provideServices.ts | 4 +-- src/short-urls/CreateShortUrl.tsx | 15 ++++---- src/short-urls/EditShortUrl.tsx | 15 ++++---- src/short-urls/Paginator.tsx | 5 +-- src/short-urls/ShortUrlForm.tsx | 19 +++++----- src/short-urls/ShortUrlsFilteringBar.tsx | 18 +++++----- src/short-urls/ShortUrlsList.tsx | 19 +++++----- src/short-urls/ShortUrlsTable.tsx | 10 +++--- src/short-urls/data/index.ts | 4 +-- .../helpers/CreateShortUrlResult.tsx | 4 +-- .../helpers/DeleteShortUrlModal.tsx | 4 +-- src/short-urls/helpers/ExportShortUrlsBtn.tsx | 11 +++--- src/short-urls/helpers/QrCodeModal.tsx | 9 ++--- src/short-urls/helpers/ShortUrlDetailLink.tsx | 7 ++-- .../helpers/ShortUrlFormCheckboxGroup.tsx | 2 +- src/short-urls/helpers/ShortUrlStatus.tsx | 6 ++-- .../helpers/ShortUrlVisitsCount.tsx | 4 +-- .../helpers/ShortUrlsFilterDropdown.tsx | 2 +- src/short-urls/helpers/ShortUrlsRow.tsx | 15 ++++---- src/short-urls/helpers/ShortUrlsRowMenu.tsx | 6 ++-- src/short-urls/helpers/Tags.tsx | 4 +-- src/short-urls/helpers/hooks.ts | 7 ++-- src/short-urls/helpers/index.ts | 6 ++-- .../qr-codes/QrErrorCorrectionDropdown.tsx | 4 +-- .../helpers/qr-codes/QrFormatDropdown.tsx | 4 +-- src/short-urls/reducers/shortUrlCreation.ts | 9 ++--- src/short-urls/reducers/shortUrlDeletion.ts | 6 ++-- src/short-urls/reducers/shortUrlDetail.ts | 9 ++--- src/short-urls/reducers/shortUrlEdition.ts | 9 ++--- src/short-urls/reducers/shortUrlsList.ts | 10 +++--- src/short-urls/services/provideServices.ts | 4 +-- src/tags/TagsList.tsx | 16 +++++---- src/tags/TagsTable.tsx | 7 ++-- src/tags/TagsTableRow.tsx | 9 ++--- src/tags/data/TagsListChildrenProps.ts | 6 ++-- src/tags/helpers/DeleteTagConfirmModal.tsx | 4 +-- src/tags/helpers/EditTagModal.tsx | 6 ++-- src/tags/helpers/Tag.tsx | 4 +-- src/tags/helpers/TagBullet.tsx | 2 +- src/tags/helpers/TagsSelector.tsx | 9 ++--- src/tags/reducers/tagDelete.ts | 4 +-- src/tags/reducers/tagEdit.ts | 9 ++--- src/tags/reducers/tagsList.ts | 12 +++---- src/tags/services/provideServices.ts | 5 +-- src/utils/BooleanControl.tsx | 2 +- src/utils/Checkbox.tsx | 5 +-- src/utils/CopyToClipboardIcon.tsx | 2 +- src/utils/DropdownBtn.tsx | 2 +- src/utils/DropdownBtnMenu.tsx | 2 +- src/utils/ExportBtn.tsx | 5 +-- src/utils/InfoTooltip.tsx | 4 +-- src/utils/Message.tsx | 2 +- src/utils/NavPills.tsx | 3 +- src/utils/OrderingDropdown.tsx | 3 +- src/utils/Result.tsx | 2 +- src/utils/SimpleCard.tsx | 5 +-- src/utils/ToggleSwitch.tsx | 5 +-- src/utils/dates/DateInput.tsx | 3 +- src/utils/dates/DateIntervalDropdownItems.tsx | 5 +-- src/utils/dates/DateIntervalSelector.tsx | 5 +-- src/utils/dates/DateRangeRow.tsx | 2 +- src/utils/dates/DateRangeSelector.tsx | 5 +-- src/utils/dates/DateTimeInput.tsx | 4 +-- src/utils/forms/FormText.tsx | 2 +- src/utils/forms/InputFormGroup.tsx | 4 +-- src/utils/forms/LabeledFormGroup.tsx | 2 +- src/utils/helpers/charts.ts | 2 +- src/utils/helpers/date.ts | 2 +- src/utils/helpers/dateIntervals.ts | 3 +- src/utils/helpers/features.ts | 6 ++-- src/utils/helpers/hooks.ts | 3 +- src/utils/helpers/redux.ts | 5 +-- src/utils/helpers/version.ts | 3 +- src/utils/helpers/visits.ts | 5 +-- src/utils/services/ColorGenerator.ts | 2 +- src/utils/services/provideServices.ts | 2 +- src/utils/table/TableOrderIcon.tsx | 2 +- src/utils/utils.ts | 2 +- src/visits/DomainVisits.tsx | 10 +++--- src/visits/NonOrphanVisits.tsx | 8 ++--- src/visits/OrphanVisits.tsx | 10 +++--- src/visits/ShortUrlVisits.tsx | 12 +++---- src/visits/ShortUrlVisitsHeader.tsx | 4 +-- src/visits/TagVisits.tsx | 12 +++---- src/visits/TagVisitsHeader.tsx | 4 +-- src/visits/VisitsHeader.tsx | 6 ++-- src/visits/VisitsStats.tsx | 17 +++++---- src/visits/VisitsTable.tsx | 7 ++-- src/visits/charts/ChartCard.tsx | 2 +- src/visits/charts/DoughnutChart.tsx | 7 ++-- src/visits/charts/DoughnutChartCard.tsx | 4 +-- src/visits/charts/DoughnutChartLegend.tsx | 4 +-- src/visits/charts/HorizontalBarChart.tsx | 7 ++-- src/visits/charts/LineChartCard.tsx | 7 ++-- src/visits/charts/SortableBarChartCard.tsx | 10 +++--- src/visits/helpers/MapModal.tsx | 7 ++-- src/visits/helpers/OpenMapModalBtn.tsx | 2 +- src/visits/helpers/VisitsFilterDropdown.tsx | 5 +-- src/visits/helpers/hooks.ts | 10 +++--- src/visits/reducers/common.ts | 11 +++--- src/visits/reducers/domainVisits.ts | 4 +-- src/visits/reducers/nonOrphanVisits.ts | 4 +-- src/visits/reducers/orphanVisits.ts | 6 ++-- src/visits/reducers/shortUrlVisits.ts | 6 ++-- src/visits/reducers/tagVisits.ts | 4 +-- src/visits/reducers/types/index.ts | 8 ++--- src/visits/reducers/visitCreation.ts | 5 +-- src/visits/reducers/visitsOverview.ts | 7 ++-- src/visits/services/VisitsParser.ts | 2 +- src/visits/services/provideServices.ts | 4 +-- src/visits/types/CommonVisitsProps.ts | 2 +- src/visits/types/helpers.ts | 4 +-- src/visits/types/index.ts | 4 +-- test/__helpers__/TestModalWrapper.tsx | 2 +- test/__helpers__/setUpTest.ts | 2 +- test/api/ShlinkApiError.test.tsx | 6 ++-- test/api/services/ShlinkApiClient.test.ts | 8 ++--- .../services/ShlinkApiClientBuilder.test.ts | 6 ++-- test/app/App.test.tsx | 2 +- test/common/AsideMenu.test.tsx | 2 +- test/common/Home.test.tsx | 2 +- test/common/MenuLayout.test.tsx | 4 +-- test/common/ShlinkVersions.test.tsx | 5 +-- test/common/ShlinkVersionsContainer.test.tsx | 4 +-- test/common/img/ShlinkLogo.test.tsx | 3 +- test/common/services/ImageDownloader.test.ts | 2 +- test/common/services/ReportExporter.test.ts | 4 +-- test/domains/DomainRow.test.tsx | 6 ++-- test/domains/DomainSelector.test.tsx | 4 +-- test/domains/ManageDomains.test.tsx | 8 ++--- test/domains/helpers/DomainDropdown.test.tsx | 6 ++-- .../domains/helpers/DomainStatusIcon.test.tsx | 2 +- .../helpers/EditDomainRedirectsModal.test.tsx | 2 +- test/domains/reducers/domainRedirects.test.ts | 7 ++-- test/domains/reducers/domainsList.test.ts | 13 +++---- test/mercure/helpers/index.test.tsx | 2 +- test/mercure/reducers/mercureInfo.test.ts | 4 +-- test/servers/CreateServer.test.tsx | 2 +- test/servers/DeleteServerButton.test.tsx | 4 +-- test/servers/DeleteServerModal.test.tsx | 2 +- test/servers/EditServer.test.tsx | 2 +- test/servers/ManageServers.test.tsx | 4 +-- test/servers/ManageServersRow.test.tsx | 2 +- .../servers/ManageServersRowDropdown.test.tsx | 2 +- test/servers/Overview.test.tsx | 10 +++--- test/servers/ServersDropdown.test.tsx | 2 +- test/servers/ServersListGroup.test.tsx | 2 +- .../helpers/DuplicatedServersModal.test.tsx | 2 +- test/servers/helpers/HighlightCard.test.tsx | 5 +-- .../servers/helpers/ImportServersBtn.test.tsx | 7 ++-- test/servers/helpers/ServerError.test.tsx | 2 +- test/servers/reducers/remoteServers.test.ts | 2 +- test/servers/reducers/selectedServer.test.ts | 6 ++-- test/servers/reducers/servers.test.ts | 2 +- test/servers/services/ServersExporter.test.ts | 2 +- test/servers/services/ServersImporter.test.ts | 2 +- .../settings/RealTimeUpdatesSettings.test.tsx | 2 +- .../ShortUrlCreationSettings.test.tsx | 2 +- test/settings/ShortUrlsListSettings.test.tsx | 4 +-- test/settings/TagsSettings.test.tsx | 4 +-- test/settings/UserInterfaceSettings.test.tsx | 4 +-- test/settings/VisitsSettings.test.tsx | 2 +- test/settings/helpers/index.test.ts | 2 +- test/short-urls/CreateShortUrl.test.tsx | 4 +-- test/short-urls/EditShortUrl.test.tsx | 8 ++--- test/short-urls/Paginator.test.tsx | 2 +- test/short-urls/ShortUrlForm.test.tsx | 9 ++--- .../short-urls/ShortUrlsFilteringBar.test.tsx | 6 ++-- test/short-urls/ShortUrlsList.test.tsx | 14 ++++---- test/short-urls/ShortUrlsTable.test.tsx | 7 ++-- .../helpers/CreateShortUrlResult.test.tsx | 6 ++-- .../helpers/DeleteShortUrlModal.test.tsx | 7 ++-- .../helpers/ExportShortUrlsBtn.test.tsx | 4 +-- test/short-urls/helpers/QrCodeModal.test.tsx | 8 ++--- .../helpers/ShortUrlDetailLink.test.tsx | 7 ++-- .../helpers/ShortUrlStatus.test.tsx | 2 +- .../helpers/ShortUrlVisitsCount.test.tsx | 2 +- test/short-urls/helpers/ShortUrlsRow.test.tsx | 10 +++--- .../helpers/ShortUrlsRowMenu.test.tsx | 4 +-- test/short-urls/helpers/index.test.ts | 2 +- .../QrErrorCorrectionDropdown.test.tsx | 2 +- .../qr-codes/QrFormatDropdown.test.tsx | 2 +- .../reducers/shortUrlCreation.test.ts | 9 ++--- .../reducers/shortUrlDeletion.test.ts | 4 +-- .../reducers/shortUrlDetail.test.ts | 11 +++--- .../reducers/shortUrlEdition.test.ts | 9 ++--- .../short-urls/reducers/shortUrlsList.test.ts | 6 ++-- test/tags/TagsList.test.tsx | 9 ++--- test/tags/TagsTable.test.tsx | 4 +-- test/tags/TagsTableRow.test.tsx | 2 +- .../helpers/DeleteTagConfirmModal.test.tsx | 2 +- test/tags/helpers/EditTagModal.test.tsx | 6 ++-- test/tags/helpers/Tag.test.tsx | 4 +-- test/tags/helpers/TagsSelector.test.tsx | 4 +-- test/tags/reducers/tagDelete.test.ts | 4 +-- test/tags/reducers/tagEdit.test.ts | 9 ++--- test/tags/reducers/tagsList.test.ts | 7 ++-- test/utils/DropdownBtn.test.tsx | 5 +-- test/utils/DropdownBtnMenu.test.tsx | 3 +- test/utils/InfoTooltip.test.tsx | 5 +-- test/utils/Message.test.tsx | 5 +-- test/utils/OrderingDropdown.test.tsx | 5 +-- test/utils/Result.test.tsx | 3 +- test/utils/dates/DateInput.test.tsx | 3 +- .../dates/DateIntervalDropdownItems.test.tsx | 3 +- .../utils/dates/DateIntervalSelector.test.tsx | 3 +- test/utils/dates/DateRangeSelector.test.tsx | 5 +-- test/utils/dates/Time.test.tsx | 3 +- test/utils/helpers/dateIntervals.test.ts | 3 +- test/utils/helpers/ordering.test.ts | 3 +- test/utils/helpers/qrCodes.test.ts | 3 +- test/utils/helpers/version.test.ts | 5 +-- test/utils/services/ColorGenerator.test.ts | 2 +- .../services/__mocks__/ColorGenerator.mock.ts | 2 +- test/utils/table/TableOrderIcon.test.tsx | 2 +- test/visits/DomainVisits.test.tsx | 10 +++--- test/visits/NonOrphanVisits.test.tsx | 10 +++--- test/visits/OrphanVisits.test.tsx | 10 +++--- test/visits/ShortUrlVisits.test.tsx | 15 ++++---- test/visits/ShortUrlVisitsHeader.test.tsx | 4 +-- test/visits/TagVisits.test.tsx | 15 ++++---- test/visits/TagVisitsHeader.test.tsx | 4 +-- test/visits/VisitsHeader.test.tsx | 2 +- test/visits/VisitsStats.test.tsx | 6 ++-- test/visits/VisitsTable.test.tsx | 5 +-- test/visits/charts/ChartCard.test.tsx | 2 +- .../charts/DoughnutChartLegend.test.tsx | 2 +- .../visits/charts/HorizontalBarChart.test.tsx | 3 +- test/visits/charts/LineChartCard.test.tsx | 2 +- .../charts/SortableBarChartCard.test.tsx | 4 +-- test/visits/helpers/MapModal.test.tsx | 2 +- test/visits/helpers/OpenMapModalBtn.test.tsx | 2 +- .../helpers/VisitsFilterDropdown.test.tsx | 2 +- test/visits/reducers/domainVisits.test.ts | 15 ++++---- test/visits/reducers/nonOrphanVisits.test.ts | 12 +++---- test/visits/reducers/orphanVisits.test.ts | 12 +++---- test/visits/reducers/shortUrlVisits.test.ts | 13 +++---- test/visits/reducers/tagVisits.test.ts | 13 +++---- test/visits/reducers/visitCreation.test.ts | 4 +-- test/visits/reducers/visitsOverview.test.ts | 16 +++++---- test/visits/services/VisitsParser.test.ts | 2 +- test/visits/types/helpers.test.ts | 7 ++-- 317 files changed, 955 insertions(+), 807 deletions(-) diff --git a/src/api/ShlinkApiError.tsx b/src/api/ShlinkApiError.tsx index 6b78da38..2277165a 100644 --- a/src/api/ShlinkApiError.tsx +++ b/src/api/ShlinkApiError.tsx @@ -1,5 +1,5 @@ import { isInvalidArgumentError } from './utils'; -import { ProblemDetailsError } from './types/errors'; +import type { ProblemDetailsError } from './types/errors'; export interface ShlinkApiErrorProps { errorData?: ProblemDetailsError; diff --git a/src/api/services/ShlinkApiClient.ts b/src/api/services/ShlinkApiClient.ts index d3f1626b..3d160d36 100644 --- a/src/api/services/ShlinkApiClient.ts +++ b/src/api/services/ShlinkApiClient.ts @@ -1,7 +1,7 @@ import { isEmpty, isNil, reject } from 'ramda'; -import { ShortUrl, ShortUrlData } from '../../short-urls/data'; -import { OptionalString } from '../../utils/utils'; -import { +import type { ShortUrl, ShortUrlData } from '../../short-urls/data'; +import type { OptionalString } from '../../utils/utils'; +import type { ShlinkHealth, ShlinkMercureInfo, ShlinkShortUrlsResponse, @@ -20,7 +20,7 @@ import { import { orderToString } from '../../utils/helpers/ordering'; import { isRegularNotFound, parseApiError } from '../utils'; import { stringifyQuery } from '../../utils/helpers/query'; -import { HttpClient } from '../../common/services/HttpClient'; +import type { HttpClient } from '../../common/services/HttpClient'; const buildShlinkBaseUrl = (url: string, version: 2 | 3) => `${url}/rest/v${version}`; const rejectNilProps = reject(isNil); diff --git a/src/api/services/ShlinkApiClientBuilder.ts b/src/api/services/ShlinkApiClientBuilder.ts index ef74356a..0bc7c98f 100644 --- a/src/api/services/ShlinkApiClientBuilder.ts +++ b/src/api/services/ShlinkApiClientBuilder.ts @@ -1,7 +1,8 @@ -import { hasServerData, ServerWithId } from '../../servers/data'; -import { GetState } from '../../container/types'; +import type { ServerWithId } from '../../servers/data'; +import { hasServerData } from '../../servers/data'; +import type { GetState } from '../../container/types'; import { ShlinkApiClient } from './ShlinkApiClient'; -import { HttpClient } from '../../common/services/HttpClient'; +import type { HttpClient } from '../../common/services/HttpClient'; const apiClients: Record = {}; diff --git a/src/api/services/provideServices.ts b/src/api/services/provideServices.ts index c8bcd854..b541006c 100644 --- a/src/api/services/provideServices.ts +++ b/src/api/services/provideServices.ts @@ -1,4 +1,4 @@ -import Bottle from 'bottlejs'; +import type Bottle from 'bottlejs'; import { buildShlinkApiClient } from './ShlinkApiClientBuilder'; const provideServices = (bottle: Bottle) => { diff --git a/src/api/types/index.ts b/src/api/types/index.ts index ef51e9b2..a1c8d028 100644 --- a/src/api/types/index.ts +++ b/src/api/types/index.ts @@ -1,7 +1,7 @@ -import { Visit } from '../../visits/types'; -import { OptionalString } from '../../utils/utils'; -import { ShortUrl, ShortUrlMeta } from '../../short-urls/data'; -import { Order } from '../../utils/helpers/ordering'; +import type { Visit } from '../../visits/types'; +import type { OptionalString } from '../../utils/utils'; +import type { ShortUrl, ShortUrlMeta } from '../../short-urls/data'; +import type { Order } from '../../utils/helpers/ordering'; export interface ShlinkShortUrlsResponse { data: ShortUrl[]; diff --git a/src/api/utils/index.ts b/src/api/utils/index.ts index 4d60a21e..f9af97fe 100644 --- a/src/api/utils/index.ts +++ b/src/api/utils/index.ts @@ -1,10 +1,11 @@ -import { - ErrorTypeV2, - ErrorTypeV3, +import type { InvalidArgumentError, InvalidShortUrlDeletion, ProblemDetailsError, - RegularNotFound, + RegularNotFound } from '../types/errors'; +import { + ErrorTypeV2, + ErrorTypeV3, } from '../types/errors'; const isProblemDetails = (e: unknown): e is ProblemDetailsError => diff --git a/src/app/App.tsx b/src/app/App.tsx index 457a50d7..c3f68a9e 100644 --- a/src/app/App.tsx +++ b/src/app/App.tsx @@ -1,9 +1,10 @@ -import { useEffect, FC } from 'react'; +import type { FC } from 'react'; +import { useEffect } from 'react'; import { Route, Routes, useLocation } from 'react-router-dom'; import classNames from 'classnames'; import { NotFound } from '../common/NotFound'; -import { ServersMap } from '../servers/data'; -import { Settings } from '../settings/reducers/settings'; +import type { ServersMap } from '../servers/data'; +import type { Settings } from '../settings/reducers/settings'; import { changeThemeInMarkup } from '../utils/theme'; import { AppUpdateBanner } from '../common/AppUpdateBanner'; import { forceUpdate } from '../utils/helpers/sw'; diff --git a/src/app/services/provideServices.ts b/src/app/services/provideServices.ts index a69d6cbc..f04b87b6 100644 --- a/src/app/services/provideServices.ts +++ b/src/app/services/provideServices.ts @@ -1,7 +1,7 @@ -import Bottle from 'bottlejs'; +import type Bottle from 'bottlejs'; import { appUpdateAvailable, resetAppUpdate } from '../reducers/appUpdates'; import { App } from '../App'; -import { ConnectDecorator } from '../../container/types'; +import type { ConnectDecorator } from '../../container/types'; const provideServices = (bottle: Bottle, connect: ConnectDecorator) => { // Components diff --git a/src/common/AppUpdateBanner.tsx b/src/common/AppUpdateBanner.tsx index 300679c7..553e3d8d 100644 --- a/src/common/AppUpdateBanner.tsx +++ b/src/common/AppUpdateBanner.tsx @@ -1,4 +1,4 @@ -import { FC, MouseEventHandler } from 'react'; +import type { FC, MouseEventHandler } from 'react'; import { Alert, Button } from 'reactstrap'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { faSyncAlt as reloadIcon } from '@fortawesome/free-solid-svg-icons'; diff --git a/src/common/AsideMenu.tsx b/src/common/AsideMenu.tsx index b8ae44f8..25a09418 100644 --- a/src/common/AsideMenu.tsx +++ b/src/common/AsideMenu.tsx @@ -7,11 +7,13 @@ import { faGlobe as domainsIcon, } from '@fortawesome/free-solid-svg-icons'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; -import { FC } from 'react'; -import { NavLink, NavLinkProps, useLocation } from 'react-router-dom'; +import type { FC } from 'react'; +import type { NavLinkProps } from 'react-router-dom'; +import { NavLink, useLocation } from 'react-router-dom'; import classNames from 'classnames'; -import { DeleteServerButtonProps } from '../servers/DeleteServerButton'; -import { isServerWithId, SelectedServer } from '../servers/data'; +import type { DeleteServerButtonProps } from '../servers/DeleteServerButton'; +import type { SelectedServer } from '../servers/data'; +import { isServerWithId } from '../servers/data'; import './AsideMenu.scss'; export interface AsideMenuProps { diff --git a/src/common/ErrorHandler.tsx b/src/common/ErrorHandler.tsx index 0a23968b..f01178cc 100644 --- a/src/common/ErrorHandler.tsx +++ b/src/common/ErrorHandler.tsx @@ -1,4 +1,5 @@ -import { Component, ReactNode } from 'react'; +import type { ReactNode } from 'react'; +import { Component } from 'react'; import { Button } from 'reactstrap'; import { SimpleCard } from '../utils/SimpleCard'; diff --git a/src/common/Home.tsx b/src/common/Home.tsx index 018f9ce3..74570e2a 100644 --- a/src/common/Home.tsx +++ b/src/common/Home.tsx @@ -6,7 +6,7 @@ import { ExternalLink } from 'react-external-link'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { faExternalLinkAlt, faPlus } from '@fortawesome/free-solid-svg-icons'; import { ServersListGroup } from '../servers/ServersListGroup'; -import { ServersMap } from '../servers/data'; +import type { ServersMap } from '../servers/data'; import { ShlinkLogo } from './img/ShlinkLogo'; import './Home.scss'; diff --git a/src/common/MainHeader.tsx b/src/common/MainHeader.tsx index 29c6f41c..1d07f698 100644 --- a/src/common/MainHeader.tsx +++ b/src/common/MainHeader.tsx @@ -1,6 +1,7 @@ import { faChevronDown as arrowIcon, faCogs as cogsIcon } from '@fortawesome/free-solid-svg-icons'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; -import { FC, useEffect } from 'react'; +import type { FC } from 'react'; +import { useEffect } from 'react'; import { Link, useLocation } from 'react-router-dom'; import { Collapse, Nav, Navbar, NavbarBrand, NavbarToggler, NavItem, NavLink } from 'reactstrap'; import classNames from 'classnames'; diff --git a/src/common/MenuLayout.tsx b/src/common/MenuLayout.tsx index 58f7da2d..a1c441f5 100644 --- a/src/common/MenuLayout.tsx +++ b/src/common/MenuLayout.tsx @@ -1,4 +1,5 @@ -import { FC, useEffect } from 'react'; +import type { FC } from 'react'; +import { useEffect } from 'react'; import { Navigate, Route, Routes, useLocation } from 'react-router-dom'; import { faBars as burgerIcon } from '@fortawesome/free-solid-svg-icons'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; @@ -8,7 +9,7 @@ import { useSwipeable, useToggle } from '../utils/helpers/hooks'; import { supportsDomainVisits, supportsNonOrphanVisits } from '../utils/helpers/features'; import { isReachableServer } from '../servers/data'; import { NotFound } from './NotFound'; -import { AsideMenuProps } from './AsideMenu'; +import type { AsideMenuProps } from './AsideMenu'; import './MenuLayout.scss'; interface MenuLayoutProps { diff --git a/src/common/NoMenuLayout.tsx b/src/common/NoMenuLayout.tsx index 9e44c15b..e853774d 100644 --- a/src/common/NoMenuLayout.tsx +++ b/src/common/NoMenuLayout.tsx @@ -1,4 +1,4 @@ -import { FC, PropsWithChildren } from 'react'; +import type { FC, PropsWithChildren } from 'react'; import './NoMenuLayout.scss'; export const NoMenuLayout: FC> = ({ children }) => ( diff --git a/src/common/NotFound.tsx b/src/common/NotFound.tsx index 76926d5d..2e5660cc 100644 --- a/src/common/NotFound.tsx +++ b/src/common/NotFound.tsx @@ -1,4 +1,4 @@ -import { FC, PropsWithChildren } from 'react'; +import type { FC, PropsWithChildren } from 'react'; import { Link } from 'react-router-dom'; import { SimpleCard } from '../utils/SimpleCard'; diff --git a/src/common/ScrollToTop.tsx b/src/common/ScrollToTop.tsx index 0fbdda39..33f4bb3a 100644 --- a/src/common/ScrollToTop.tsx +++ b/src/common/ScrollToTop.tsx @@ -1,4 +1,5 @@ -import { FC, PropsWithChildren, useEffect } from 'react'; +import type { FC, PropsWithChildren } from 'react'; +import { useEffect } from 'react'; import { useLocation } from 'react-router-dom'; export const ScrollToTop: FC> = ({ children }) => { diff --git a/src/common/ShlinkVersions.tsx b/src/common/ShlinkVersions.tsx index e750b25f..18c1a6c8 100644 --- a/src/common/ShlinkVersions.tsx +++ b/src/common/ShlinkVersions.tsx @@ -1,7 +1,8 @@ import { pipe } from 'ramda'; import { ExternalLink } from 'react-external-link'; import { versionToPrintable, versionToSemVer } from '../utils/helpers/version'; -import { isReachableServer, SelectedServer } from '../servers/data'; +import type { SelectedServer } from '../servers/data'; +import { isReachableServer } from '../servers/data'; const SHLINK_WEB_CLIENT_VERSION = '%_VERSION_%'; const normalizeVersion = pipe(versionToSemVer(), versionToPrintable); diff --git a/src/common/ShlinkVersionsContainer.tsx b/src/common/ShlinkVersionsContainer.tsx index 0cdf8405..d6afcf45 100644 --- a/src/common/ShlinkVersionsContainer.tsx +++ b/src/common/ShlinkVersionsContainer.tsx @@ -1,7 +1,7 @@ import classNames from 'classnames'; -import { SelectedServer } from '../servers/data'; +import type { SelectedServer } from '../servers/data'; import { ShlinkVersions } from './ShlinkVersions'; -import { Sidebar } from './reducers/sidebar'; +import type { Sidebar } from './reducers/sidebar'; import './ShlinkVersionsContainer.scss'; export interface ShlinkVersionsContainerProps { diff --git a/src/common/SimplePaginator.tsx b/src/common/SimplePaginator.tsx index 9ebc2ef4..3c3cfeab 100644 --- a/src/common/SimplePaginator.tsx +++ b/src/common/SimplePaginator.tsx @@ -1,10 +1,11 @@ -import { FC } from 'react'; +import type { FC } from 'react'; import classNames from 'classnames'; import { Pagination, PaginationItem, PaginationLink } from 'reactstrap'; +import type { + NumberOrEllipsis } from '../utils/helpers/pagination'; import { pageIsEllipsis, keyForPage, - NumberOrEllipsis, progressivePagination, prettifyPageNumber, } from '../utils/helpers/pagination'; diff --git a/src/common/services/HttpClient.ts b/src/common/services/HttpClient.ts index 9a07cfea..d43cb031 100644 --- a/src/common/services/HttpClient.ts +++ b/src/common/services/HttpClient.ts @@ -1,4 +1,4 @@ -import { Fetch } from '../../utils/types'; +import type { Fetch } from '../../utils/types'; const applicationJsonHeader = { 'Content-Type': 'application/json' }; const withJsonContentType = (options?: RequestInit): RequestInit | undefined => { diff --git a/src/common/services/ImageDownloader.ts b/src/common/services/ImageDownloader.ts index 39314d7e..780de082 100644 --- a/src/common/services/ImageDownloader.ts +++ b/src/common/services/ImageDownloader.ts @@ -1,5 +1,5 @@ import { saveUrl } from '../../utils/helpers/files'; -import { HttpClient } from './HttpClient'; +import type { HttpClient } from './HttpClient'; export class ImageDownloader { public constructor(private readonly httpClient: HttpClient, private readonly window: Window) {} diff --git a/src/common/services/ReportExporter.ts b/src/common/services/ReportExporter.ts index 8976e9d9..d929b8f7 100644 --- a/src/common/services/ReportExporter.ts +++ b/src/common/services/ReportExporter.ts @@ -1,7 +1,7 @@ -import { NormalizedVisit } from '../../visits/types'; -import { ExportableShortUrl } from '../../short-urls/data'; +import type { NormalizedVisit } from '../../visits/types'; +import type { ExportableShortUrl } from '../../short-urls/data'; import { saveCsv } from '../../utils/helpers/files'; -import { JsonToCsv } from '../../utils/helpers/csvjson'; +import type { JsonToCsv } from '../../utils/helpers/csvjson'; export class ReportExporter { public constructor(private readonly window: Window, private readonly jsonToCsv: JsonToCsv) {} diff --git a/src/common/services/provideServices.ts b/src/common/services/provideServices.ts index 88a68575..918e080f 100644 --- a/src/common/services/provideServices.ts +++ b/src/common/services/provideServices.ts @@ -1,4 +1,4 @@ -import Bottle from 'bottlejs'; +import type Bottle from 'bottlejs'; import { ScrollToTop } from '../ScrollToTop'; import { MainHeader } from '../MainHeader'; import { Home } from '../Home'; @@ -6,7 +6,7 @@ import { MenuLayout } from '../MenuLayout'; import { AsideMenu } from '../AsideMenu'; import { ErrorHandler } from '../ErrorHandler'; import { ShlinkVersionsContainer } from '../ShlinkVersionsContainer'; -import { ConnectDecorator } from '../../container/types'; +import type { ConnectDecorator } from '../../container/types'; import { withoutSelectedServer } from '../../servers/helpers/withoutSelectedServer'; import { sidebarNotPresent, sidebarPresent } from '../reducers/sidebar'; import { ImageDownloader } from './ImageDownloader'; diff --git a/src/container/index.ts b/src/container/index.ts index 4618d561..86ea418e 100644 --- a/src/container/index.ts +++ b/src/container/index.ts @@ -1,4 +1,5 @@ -import Bottle, { IContainer } from 'bottlejs'; +import type { IContainer } from 'bottlejs'; +import Bottle from 'bottlejs'; import { connect as reduxConnect } from 'react-redux'; import { pick } from 'ramda'; import provideApiServices from '../api/services/provideServices'; @@ -12,7 +13,7 @@ import provideMercureServices from '../mercure/services/provideServices'; import provideSettingsServices from '../settings/services/provideServices'; import provideDomainsServices from '../domains/services/provideServices'; import provideAppServices from '../app/services/provideServices'; -import { ConnectDecorator } from './types'; +import type { ConnectDecorator } from './types'; type LazyActionMap = Record; diff --git a/src/container/store.ts b/src/container/store.ts index 590c8382..1fab3d92 100644 --- a/src/container/store.ts +++ b/src/container/store.ts @@ -1,9 +1,10 @@ -import { IContainer } from 'bottlejs'; -import { save, load, RLSOptions } from 'redux-localstorage-simple'; +import type { IContainer } from 'bottlejs'; +import type { RLSOptions } from 'redux-localstorage-simple'; +import { save, load } from 'redux-localstorage-simple'; import { configureStore } from '@reduxjs/toolkit'; import reducer from '../reducers'; import { migrateDeprecatedSettings } from '../settings/helpers'; -import { ShlinkState } from './types'; +import type { ShlinkState } from './types'; const isProduction = process.env.NODE_ENV === 'production'; const localStorageConfig: RLSOptions = { diff --git a/src/container/types.ts b/src/container/types.ts index 3be8ee4c..8013b405 100644 --- a/src/container/types.ts +++ b/src/container/types.ts @@ -1,21 +1,21 @@ -import { MercureInfo } from '../mercure/reducers/mercureInfo'; -import { SelectedServer, ServersMap } from '../servers/data'; -import { Settings } from '../settings/reducers/settings'; -import { ShortUrlCreation } from '../short-urls/reducers/shortUrlCreation'; -import { ShortUrlDeletion } from '../short-urls/reducers/shortUrlDeletion'; -import { ShortUrlEdition } from '../short-urls/reducers/shortUrlEdition'; -import { ShortUrlsList } from '../short-urls/reducers/shortUrlsList'; -import { TagDeletion } from '../tags/reducers/tagDelete'; -import { TagEdition } from '../tags/reducers/tagEdit'; -import { TagsList } from '../tags/reducers/tagsList'; -import { ShortUrlDetail } from '../short-urls/reducers/shortUrlDetail'; -import { ShortUrlVisits } from '../visits/reducers/shortUrlVisits'; -import { TagVisits } from '../visits/reducers/tagVisits'; -import { DomainsList } from '../domains/reducers/domainsList'; -import { VisitsOverview } from '../visits/reducers/visitsOverview'; -import { Sidebar } from '../common/reducers/sidebar'; -import { DomainVisits } from '../visits/reducers/domainVisits'; -import { VisitsInfo } from '../visits/reducers/types'; +import type { MercureInfo } from '../mercure/reducers/mercureInfo'; +import type { SelectedServer, ServersMap } from '../servers/data'; +import type { Settings } from '../settings/reducers/settings'; +import type { ShortUrlCreation } from '../short-urls/reducers/shortUrlCreation'; +import type { ShortUrlDeletion } from '../short-urls/reducers/shortUrlDeletion'; +import type { ShortUrlEdition } from '../short-urls/reducers/shortUrlEdition'; +import type { ShortUrlsList } from '../short-urls/reducers/shortUrlsList'; +import type { TagDeletion } from '../tags/reducers/tagDelete'; +import type { TagEdition } from '../tags/reducers/tagEdit'; +import type { TagsList } from '../tags/reducers/tagsList'; +import type { ShortUrlDetail } from '../short-urls/reducers/shortUrlDetail'; +import type { ShortUrlVisits } from '../visits/reducers/shortUrlVisits'; +import type { TagVisits } from '../visits/reducers/tagVisits'; +import type { DomainsList } from '../domains/reducers/domainsList'; +import type { VisitsOverview } from '../visits/reducers/visitsOverview'; +import type { Sidebar } from '../common/reducers/sidebar'; +import type { DomainVisits } from '../visits/reducers/domainVisits'; +import type { VisitsInfo } from '../visits/reducers/types'; export interface ShlinkState { servers: ServersMap; diff --git a/src/domains/DomainRow.tsx b/src/domains/DomainRow.tsx index e57b0f36..429a4ee5 100644 --- a/src/domains/DomainRow.tsx +++ b/src/domains/DomainRow.tsx @@ -1,14 +1,15 @@ -import { FC, useEffect } from 'react'; +import type { FC } from 'react'; +import { useEffect } from 'react'; import { UncontrolledTooltip } from 'reactstrap'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { faDotCircle as defaultDomainIcon } from '@fortawesome/free-solid-svg-icons'; -import { ShlinkDomainRedirects } from '../api/types'; -import { OptionalString } from '../utils/utils'; -import { SelectedServer } from '../servers/data'; -import { Domain } from './data'; +import type { ShlinkDomainRedirects } from '../api/types'; +import type { OptionalString } from '../utils/utils'; +import type { SelectedServer } from '../servers/data'; +import type { Domain } from './data'; import { DomainStatusIcon } from './helpers/DomainStatusIcon'; import { DomainDropdown } from './helpers/DomainDropdown'; -import { EditDomainRedirects } from './reducers/domainRedirects'; +import type { EditDomainRedirects } from './reducers/domainRedirects'; interface DomainRowProps { domain: Domain; diff --git a/src/domains/DomainSelector.tsx b/src/domains/DomainSelector.tsx index 0c8671b4..14084a79 100644 --- a/src/domains/DomainSelector.tsx +++ b/src/domains/DomainSelector.tsx @@ -1,11 +1,12 @@ import { useEffect } from 'react'; -import { Button, DropdownItem, Input, InputGroup, UncontrolledTooltip, InputProps } from 'reactstrap'; +import type { InputProps } from 'reactstrap'; +import { Button, DropdownItem, Input, InputGroup, UncontrolledTooltip } from 'reactstrap'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { faUndo } from '@fortawesome/free-solid-svg-icons'; import { isEmpty, pipe } from 'ramda'; import { DropdownBtn } from '../utils/DropdownBtn'; import { useToggle } from '../utils/helpers/hooks'; -import { DomainsList } from './reducers/domainsList'; +import type { DomainsList } from './reducers/domainsList'; import './DomainSelector.scss'; export interface DomainSelectorProps extends Omit { diff --git a/src/domains/ManageDomains.tsx b/src/domains/ManageDomains.tsx index f7c52992..de3f9e5e 100644 --- a/src/domains/ManageDomains.tsx +++ b/src/domains/ManageDomains.tsx @@ -1,12 +1,13 @@ -import { FC, useEffect } from 'react'; +import type { FC } from 'react'; +import { useEffect } from 'react'; import { Message } from '../utils/Message'; import { Result } from '../utils/Result'; import { ShlinkApiError } from '../api/ShlinkApiError'; import { SimpleCard } from '../utils/SimpleCard'; import { SearchField } from '../utils/SearchField'; -import { EditDomainRedirects } from './reducers/domainRedirects'; -import { SelectedServer } from '../servers/data'; -import { DomainsList } from './reducers/domainsList'; +import type { EditDomainRedirects } from './reducers/domainRedirects'; +import type { SelectedServer } from '../servers/data'; +import type { DomainsList } from './reducers/domainsList'; import { DomainRow } from './DomainRow'; interface ManageDomainsProps { diff --git a/src/domains/data/index.ts b/src/domains/data/index.ts index e427d87d..a6600f15 100644 --- a/src/domains/data/index.ts +++ b/src/domains/data/index.ts @@ -1,4 +1,4 @@ -import { ShlinkDomain } from '../../api/types'; +import type { ShlinkDomain } from '../../api/types'; export type DomainStatus = 'validating' | 'valid' | 'invalid'; diff --git a/src/domains/helpers/DomainDropdown.tsx b/src/domains/helpers/DomainDropdown.tsx index a91b40a8..b6d101fe 100644 --- a/src/domains/helpers/DomainDropdown.tsx +++ b/src/domains/helpers/DomainDropdown.tsx @@ -1,4 +1,4 @@ -import { FC } from 'react'; +import type { FC } from 'react'; import { DropdownItem } from 'reactstrap'; import { Link } from 'react-router-dom'; import { faChartPie as pieChartIcon, faEdit as editIcon } from '@fortawesome/free-solid-svg-icons'; @@ -6,10 +6,11 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { useToggle } from '../../utils/helpers/hooks'; import { DropdownBtnMenu } from '../../utils/DropdownBtnMenu'; import { EditDomainRedirectsModal } from './EditDomainRedirectsModal'; -import { Domain } from '../data'; -import { EditDomainRedirects } from '../reducers/domainRedirects'; +import type { Domain } from '../data'; +import type { EditDomainRedirects } from '../reducers/domainRedirects'; import { supportsDefaultDomainRedirectsEdition, supportsDomainVisits } from '../../utils/helpers/features'; -import { getServerId, SelectedServer } from '../../servers/data'; +import type { SelectedServer } from '../../servers/data'; +import { getServerId } from '../../servers/data'; import { DEFAULT_DOMAIN } from '../../visits/reducers/domainVisits'; interface DomainDropdownProps { diff --git a/src/domains/helpers/DomainStatusIcon.tsx b/src/domains/helpers/DomainStatusIcon.tsx index 7a1e6ded..6dba2f6c 100644 --- a/src/domains/helpers/DomainStatusIcon.tsx +++ b/src/domains/helpers/DomainStatusIcon.tsx @@ -1,4 +1,5 @@ -import { FC, useEffect, useState } from 'react'; +import type { FC } from 'react'; +import { useEffect, useState } from 'react'; import { UncontrolledTooltip } from 'reactstrap'; import { ExternalLink } from 'react-external-link'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; @@ -7,8 +8,8 @@ import { faCheck as checkIcon, faCircleNotch as loadingStatusIcon, } from '@fortawesome/free-solid-svg-icons'; -import { MediaMatcher } from '../../utils/types'; -import { DomainStatus } from '../data'; +import type { MediaMatcher } from '../../utils/types'; +import type { DomainStatus } from '../data'; import { useElementRef } from '../../utils/helpers/hooks'; interface DomainStatusIconProps { diff --git a/src/domains/helpers/EditDomainRedirectsModal.tsx b/src/domains/helpers/EditDomainRedirectsModal.tsx index 26d11be5..928acfb5 100644 --- a/src/domains/helpers/EditDomainRedirectsModal.tsx +++ b/src/domains/helpers/EditDomainRedirectsModal.tsx @@ -1,10 +1,12 @@ -import { FC, useState } from 'react'; +import type { FC } from 'react'; +import { useState } from 'react'; import { Button, Modal, ModalBody, ModalFooter, ModalHeader } from 'reactstrap'; -import { ShlinkDomain } from '../../api/types'; -import { InputFormGroup, InputFormGroupProps } from '../../utils/forms/InputFormGroup'; +import type { ShlinkDomain } from '../../api/types'; +import type { InputFormGroupProps } from '../../utils/forms/InputFormGroup'; +import { InputFormGroup } from '../../utils/forms/InputFormGroup'; import { handleEventPreventingDefault, nonEmptyValueOrNull } from '../../utils/utils'; import { InfoTooltip } from '../../utils/InfoTooltip'; -import { EditDomainRedirects } from '../reducers/domainRedirects'; +import type { EditDomainRedirects } from '../reducers/domainRedirects'; interface EditDomainRedirectsModalProps { domain: ShlinkDomain; diff --git a/src/domains/reducers/domainRedirects.ts b/src/domains/reducers/domainRedirects.ts index 7aea1b15..6f9e7e1e 100644 --- a/src/domains/reducers/domainRedirects.ts +++ b/src/domains/reducers/domainRedirects.ts @@ -1,6 +1,6 @@ import { createAsyncThunk } from '../../utils/helpers/redux'; -import { ShlinkApiClientBuilder } from '../../api/services/ShlinkApiClientBuilder'; -import { ShlinkDomainRedirects } from '../../api/types'; +import type { ShlinkApiClientBuilder } from '../../api/services/ShlinkApiClientBuilder'; +import type { ShlinkDomainRedirects } from '../../api/types'; const EDIT_DOMAIN_REDIRECTS = 'shlink/domainRedirects/EDIT_DOMAIN_REDIRECTS'; diff --git a/src/domains/reducers/domainsList.ts b/src/domains/reducers/domainsList.ts index f1e622e0..a4eeaec3 100644 --- a/src/domains/reducers/domainsList.ts +++ b/src/domains/reducers/domainsList.ts @@ -1,13 +1,14 @@ -import { createSlice, createAction, SliceCaseReducers, AsyncThunk } from '@reduxjs/toolkit'; +import type { SliceCaseReducers, AsyncThunk } from '@reduxjs/toolkit'; +import { createSlice, createAction } from '@reduxjs/toolkit'; import { createAsyncThunk } from '../../utils/helpers/redux'; -import { ShlinkDomainRedirects } from '../../api/types'; -import { ShlinkApiClientBuilder } from '../../api/services/ShlinkApiClientBuilder'; -import { Domain, DomainStatus } from '../data'; +import type { ShlinkDomainRedirects } from '../../api/types'; +import type { ShlinkApiClientBuilder } from '../../api/services/ShlinkApiClientBuilder'; +import type { Domain, DomainStatus } from '../data'; import { hasServerData } from '../../servers/data'; import { replaceAuthorityFromUri } from '../../utils/helpers/uri'; -import { ProblemDetailsError } from '../../api/types/errors'; +import type { ProblemDetailsError } from '../../api/types/errors'; import { parseApiError } from '../../api/utils'; -import { EditDomainRedirects } from './domainRedirects'; +import type { EditDomainRedirects } from './domainRedirects'; const REDUCER_PREFIX = 'shlink/domainsList'; diff --git a/src/domains/services/provideServices.ts b/src/domains/services/provideServices.ts index 827302a3..66dbc06a 100644 --- a/src/domains/services/provideServices.ts +++ b/src/domains/services/provideServices.ts @@ -1,6 +1,6 @@ import { prop } from 'ramda'; -import Bottle from 'bottlejs'; -import { ConnectDecorator } from '../../container/types'; +import type Bottle from 'bottlejs'; +import type { ConnectDecorator } from '../../container/types'; import { domainsListReducerCreator } from '../reducers/domainsList'; import { DomainSelector } from '../DomainSelector'; import { ManageDomains } from '../ManageDomains'; diff --git a/src/mercure/helpers/boundToMercureHub.tsx b/src/mercure/helpers/boundToMercureHub.tsx index a9436237..9334a754 100644 --- a/src/mercure/helpers/boundToMercureHub.tsx +++ b/src/mercure/helpers/boundToMercureHub.tsx @@ -1,8 +1,9 @@ -import { FC, useEffect } from 'react'; +import type { FC } from 'react'; +import { useEffect } from 'react'; import { pipe } from 'ramda'; import { useParams } from 'react-router-dom'; -import { CreateVisit } from '../../visits/types'; -import { MercureInfo } from '../reducers/mercureInfo'; +import type { CreateVisit } from '../../visits/types'; +import type { MercureInfo } from '../reducers/mercureInfo'; import { bindToMercureTopic } from './index'; export interface MercureBoundProps { diff --git a/src/mercure/helpers/index.ts b/src/mercure/helpers/index.ts index 0368c8ee..26d2f09a 100644 --- a/src/mercure/helpers/index.ts +++ b/src/mercure/helpers/index.ts @@ -1,5 +1,5 @@ import { EventSourcePolyfill as EventSource } from 'event-source-polyfill'; -import { MercureInfo } from '../reducers/mercureInfo'; +import type { MercureInfo } from '../reducers/mercureInfo'; export const bindToMercureTopic = (mercureInfo: MercureInfo, topics: string[], onMessage: (message: T) => void, onTokenExpired: () => void) => { // eslint-disable-line max-len const { mercureHubUrl, token, loading, error } = mercureInfo; diff --git a/src/mercure/reducers/mercureInfo.ts b/src/mercure/reducers/mercureInfo.ts index d9ec7974..6b704e79 100644 --- a/src/mercure/reducers/mercureInfo.ts +++ b/src/mercure/reducers/mercureInfo.ts @@ -1,7 +1,7 @@ import { createSlice } from '@reduxjs/toolkit'; import { createAsyncThunk } from '../../utils/helpers/redux'; -import { ShlinkMercureInfo } from '../../api/types'; -import { ShlinkApiClientBuilder } from '../../api/services/ShlinkApiClientBuilder'; +import type { ShlinkMercureInfo } from '../../api/types'; +import type { ShlinkApiClientBuilder } from '../../api/services/ShlinkApiClientBuilder'; const REDUCER_PREFIX = 'shlink/mercure'; diff --git a/src/mercure/services/provideServices.ts b/src/mercure/services/provideServices.ts index 06c341c7..07e3c18f 100644 --- a/src/mercure/services/provideServices.ts +++ b/src/mercure/services/provideServices.ts @@ -1,5 +1,5 @@ import { prop } from 'ramda'; -import Bottle from 'bottlejs'; +import type Bottle from 'bottlejs'; import { mercureInfoReducerCreator } from '../reducers/mercureInfo'; const provideServices = (bottle: Bottle) => { diff --git a/src/reducers/index.ts b/src/reducers/index.ts index 56734ac7..23b9732c 100644 --- a/src/reducers/index.ts +++ b/src/reducers/index.ts @@ -1,10 +1,10 @@ -import { IContainer } from 'bottlejs'; +import type { IContainer } from 'bottlejs'; import { combineReducers } from '@reduxjs/toolkit'; import { serversReducer } from '../servers/reducers/servers'; import { settingsReducer } from '../settings/reducers/settings'; import { appUpdatesReducer } from '../app/reducers/appUpdates'; import { sidebarReducer } from '../common/reducers/sidebar'; -import { ShlinkState } from '../container/types'; +import type { ShlinkState } from '../container/types'; export default (container: IContainer) => combineReducers({ servers: serversReducer, diff --git a/src/servers/CreateServer.tsx b/src/servers/CreateServer.tsx index 4ffd93ea..754cb6eb 100644 --- a/src/servers/CreateServer.tsx +++ b/src/servers/CreateServer.tsx @@ -1,13 +1,15 @@ -import { FC, useEffect, useState } from 'react'; +import type { FC } from 'react'; +import { useEffect, useState } from 'react'; import { v4 as uuid } from 'uuid'; import { Button } from 'reactstrap'; import { useNavigate } from 'react-router-dom'; import { Result } from '../utils/Result'; import { NoMenuLayout } from '../common/NoMenuLayout'; -import { TimeoutToggle, useGoBack, useToggle } from '../utils/helpers/hooks'; +import type { TimeoutToggle } from '../utils/helpers/hooks'; +import { useGoBack, useToggle } from '../utils/helpers/hooks'; import { ServerForm } from './helpers/ServerForm'; -import { ImportServersBtnProps } from './helpers/ImportServersBtn'; -import { ServerData, ServersMap, ServerWithId } from './data'; +import type { ImportServersBtnProps } from './helpers/ImportServersBtn'; +import type { ServerData, ServersMap, ServerWithId } from './data'; import { DuplicatedServersModal } from './helpers/DuplicatedServersModal'; const SHOW_IMPORT_MSG_TIME = 4000; diff --git a/src/servers/DeleteServerButton.tsx b/src/servers/DeleteServerButton.tsx index 4759938c..29b31ca6 100644 --- a/src/servers/DeleteServerButton.tsx +++ b/src/servers/DeleteServerButton.tsx @@ -1,9 +1,9 @@ -import { FC, PropsWithChildren } from 'react'; +import type { FC, PropsWithChildren } from 'react'; import { faMinusCircle as deleteIcon } from '@fortawesome/free-solid-svg-icons'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { useToggle } from '../utils/helpers/hooks'; -import { DeleteServerModalProps } from './DeleteServerModal'; -import { ServerWithId } from './data'; +import type { DeleteServerModalProps } from './DeleteServerModal'; +import type { ServerWithId } from './data'; export type DeleteServerButtonProps = PropsWithChildren<{ server: ServerWithId; diff --git a/src/servers/DeleteServerModal.tsx b/src/servers/DeleteServerModal.tsx index d22c93c4..1ef0284c 100644 --- a/src/servers/DeleteServerModal.tsx +++ b/src/servers/DeleteServerModal.tsx @@ -1,7 +1,8 @@ -import { FC, useRef } from 'react'; +import type { FC } from 'react'; +import { useRef } from 'react'; import { Button, Modal, ModalBody, ModalFooter, ModalHeader } from 'reactstrap'; import { useNavigate } from 'react-router-dom'; -import { ServerWithId } from './data'; +import type { ServerWithId } from './data'; export interface DeleteServerModalProps { server: ServerWithId; diff --git a/src/servers/EditServer.tsx b/src/servers/EditServer.tsx index e95b4daa..4ce07501 100644 --- a/src/servers/EditServer.tsx +++ b/src/servers/EditServer.tsx @@ -1,10 +1,11 @@ -import { FC } from 'react'; +import type { FC } from 'react'; import { Button } from 'reactstrap'; import { NoMenuLayout } from '../common/NoMenuLayout'; import { useGoBack, useParsedQuery } from '../utils/helpers/hooks'; import { ServerForm } from './helpers/ServerForm'; import { withSelectedServer } from './helpers/withSelectedServer'; -import { isServerWithId, ServerData } from './data'; +import type { ServerData } from './data'; +import { isServerWithId } from './data'; interface EditServerProps { editServer: (serverId: string, serverData: ServerData) => void; diff --git a/src/servers/ManageServers.tsx b/src/servers/ManageServers.tsx index 80f91d61..4c6c9c42 100644 --- a/src/servers/ManageServers.tsx +++ b/src/servers/ManageServers.tsx @@ -1,4 +1,5 @@ -import { FC, useEffect, useState } from 'react'; +import type { FC } from 'react'; +import { useEffect, useState } from 'react'; import { Button, Row } from 'reactstrap'; import { faFileDownload as exportIcon, faPlus as plusIcon } from '@fortawesome/free-solid-svg-icons'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; @@ -7,11 +8,11 @@ import { NoMenuLayout } from '../common/NoMenuLayout'; import { SimpleCard } from '../utils/SimpleCard'; import { SearchField } from '../utils/SearchField'; import { Result } from '../utils/Result'; -import { TimeoutToggle } from '../utils/helpers/hooks'; -import { ImportServersBtnProps } from './helpers/ImportServersBtn'; -import { ServersMap } from './data'; -import { ManageServersRowProps } from './ManageServersRow'; -import ServersExporter from './services/ServersExporter'; +import type { TimeoutToggle } from '../utils/helpers/hooks'; +import type { ImportServersBtnProps } from './helpers/ImportServersBtn'; +import type { ServersMap } from './data'; +import type { ManageServersRowProps } from './ManageServersRow'; +import type ServersExporter from './services/ServersExporter'; interface ManageServersProps { servers: ServersMap; diff --git a/src/servers/ManageServersRow.tsx b/src/servers/ManageServersRow.tsx index b072bf2b..913fb21f 100644 --- a/src/servers/ManageServersRow.tsx +++ b/src/servers/ManageServersRow.tsx @@ -1,10 +1,10 @@ -import { FC } from 'react'; +import type { FC } from 'react'; import { UncontrolledTooltip } from 'reactstrap'; import { Link } from 'react-router-dom'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { faCheck as checkIcon } from '@fortawesome/free-solid-svg-icons'; -import { ServerWithId } from './data'; -import { ManageServersRowDropdownProps } from './ManageServersRowDropdown'; +import type { ServerWithId } from './data'; +import type { ManageServersRowDropdownProps } from './ManageServersRowDropdown'; export interface ManageServersRowProps { server: ServerWithId; diff --git a/src/servers/ManageServersRowDropdown.tsx b/src/servers/ManageServersRowDropdown.tsx index f0da17a5..0a4f7d0c 100644 --- a/src/servers/ManageServersRowDropdown.tsx +++ b/src/servers/ManageServersRowDropdown.tsx @@ -1,4 +1,4 @@ -import { FC } from 'react'; +import type { FC } from 'react'; import { DropdownItem } from 'reactstrap'; import { Link } from 'react-router-dom'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; @@ -11,8 +11,8 @@ import { import { faCircle as toggleOnIcon } from '@fortawesome/free-regular-svg-icons'; import { DropdownBtnMenu } from '../utils/DropdownBtnMenu'; import { useToggle } from '../utils/helpers/hooks'; -import { DeleteServerModalProps } from './DeleteServerModal'; -import { ServerWithId } from './data'; +import type { DeleteServerModalProps } from './DeleteServerModal'; +import type { ServerWithId } from './data'; export interface ManageServersRowDropdownProps { server: ServerWithId; diff --git a/src/servers/Overview.tsx b/src/servers/Overview.tsx index d751a534..d7c52b22 100644 --- a/src/servers/Overview.tsx +++ b/src/servers/Overview.tsx @@ -1,17 +1,20 @@ -import { FC, useEffect } from 'react'; +import type { FC } from 'react'; +import { useEffect } from 'react'; import { Card, CardBody, CardHeader, Row } from 'reactstrap'; import { Link, useNavigate } from 'react-router-dom'; -import { ITEMS_IN_OVERVIEW_PAGE, ShortUrlsList as ShortUrlsListState } from '../short-urls/reducers/shortUrlsList'; +import type { ShortUrlsList as ShortUrlsListState } from '../short-urls/reducers/shortUrlsList'; +import { ITEMS_IN_OVERVIEW_PAGE } from '../short-urls/reducers/shortUrlsList'; import { prettify } from '../utils/helpers/numbers'; -import { TagsList } from '../tags/reducers/tagsList'; -import { ShortUrlsTableType } from '../short-urls/ShortUrlsTable'; +import type { TagsList } from '../tags/reducers/tagsList'; +import type { ShortUrlsTableType } from '../short-urls/ShortUrlsTable'; import { boundToMercureHub } from '../mercure/helpers/boundToMercureHub'; -import { CreateShortUrlProps } from '../short-urls/CreateShortUrl'; -import { VisitsOverview } from '../visits/reducers/visitsOverview'; +import type { CreateShortUrlProps } from '../short-urls/CreateShortUrl'; +import type { VisitsOverview } from '../visits/reducers/visitsOverview'; import { Topics } from '../mercure/helpers/Topics'; -import { ShlinkShortUrlsListParams } from '../api/types'; +import type { ShlinkShortUrlsListParams } from '../api/types'; import { supportsNonOrphanVisits } from '../utils/helpers/features'; -import { getServerId, SelectedServer } from './data'; +import type { SelectedServer } from './data'; +import { getServerId } from './data'; import { HighlightCard } from './helpers/HighlightCard'; interface OverviewConnectProps { diff --git a/src/servers/ServersDropdown.tsx b/src/servers/ServersDropdown.tsx index e549471a..b50e087f 100644 --- a/src/servers/ServersDropdown.tsx +++ b/src/servers/ServersDropdown.tsx @@ -3,7 +3,8 @@ import { DropdownItem, DropdownMenu, DropdownToggle, UncontrolledDropdown } from import { Link } from 'react-router-dom'; import { faPlus as plusIcon, faServer as serverIcon } from '@fortawesome/free-solid-svg-icons'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; -import { getServerId, SelectedServer, ServersMap } from './data'; +import type { SelectedServer, ServersMap } from './data'; +import { getServerId } from './data'; export interface ServersDropdownProps { servers: ServersMap; diff --git a/src/servers/ServersListGroup.tsx b/src/servers/ServersListGroup.tsx index 36bac3bf..0e3944b4 100644 --- a/src/servers/ServersListGroup.tsx +++ b/src/servers/ServersListGroup.tsx @@ -1,10 +1,10 @@ -import { FC, PropsWithChildren } from 'react'; +import type { FC, PropsWithChildren } from 'react'; import { ListGroup, ListGroupItem } from 'reactstrap'; import { Link } from 'react-router-dom'; import classNames from 'classnames'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { faChevronRight as chevronIcon } from '@fortawesome/free-solid-svg-icons'; -import { ServerWithId } from './data'; +import type { ServerWithId } from './data'; import './ServersListGroup.scss'; type ServersListGroupProps = PropsWithChildren<{ diff --git a/src/servers/data/index.ts b/src/servers/data/index.ts index 7ee3351e..52a98a6f 100644 --- a/src/servers/data/index.ts +++ b/src/servers/data/index.ts @@ -1,5 +1,5 @@ import { omit } from 'ramda'; -import { SemVer } from '../../utils/helpers/version'; +import type { SemVer } from '../../utils/helpers/version'; export interface ServerData { name: string; diff --git a/src/servers/helpers/DuplicatedServersModal.tsx b/src/servers/helpers/DuplicatedServersModal.tsx index 2f8a43c1..858e7993 100644 --- a/src/servers/helpers/DuplicatedServersModal.tsx +++ b/src/servers/helpers/DuplicatedServersModal.tsx @@ -1,6 +1,7 @@ -import { FC, Fragment } from 'react'; +import type { FC } from 'react'; +import { Fragment } from 'react'; import { Button, Modal, ModalBody, ModalFooter, ModalHeader } from 'reactstrap'; -import { ServerData } from '../data'; +import type { ServerData } from '../data'; interface DuplicatedServersModalProps { duplicatedServers: ServerData[]; diff --git a/src/servers/helpers/HighlightCard.tsx b/src/servers/helpers/HighlightCard.tsx index d5a6f1ef..ea6bf908 100644 --- a/src/servers/helpers/HighlightCard.tsx +++ b/src/servers/helpers/HighlightCard.tsx @@ -1,4 +1,4 @@ -import { FC, PropsWithChildren } from 'react'; +import type { FC, PropsWithChildren } from 'react'; import { Card, CardText, CardTitle } from 'reactstrap'; import { Link } from 'react-router-dom'; import { faArrowAltCircleRight as linkIcon } from '@fortawesome/free-regular-svg-icons'; diff --git a/src/servers/helpers/ImportServersBtn.tsx b/src/servers/helpers/ImportServersBtn.tsx index 4ce8502a..d163b6d3 100644 --- a/src/servers/helpers/ImportServersBtn.tsx +++ b/src/servers/helpers/ImportServersBtn.tsx @@ -1,11 +1,12 @@ -import { ChangeEvent, useState, useEffect, FC, PropsWithChildren } from 'react'; +import type { ChangeEvent, FC, PropsWithChildren } from 'react'; +import { useState, useEffect } from 'react'; import { Button, UncontrolledTooltip } from 'reactstrap'; import { complement, pipe } from 'ramda'; import { faFileUpload as importIcon } from '@fortawesome/free-solid-svg-icons'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { useElementRef, useToggle } from '../../utils/helpers/hooks'; -import { ServersImporter } from '../services/ServersImporter'; -import { ServerData, ServersMap } from '../data'; +import type { ServersImporter } from '../services/ServersImporter'; +import type { ServerData, ServersMap } from '../data'; import { DuplicatedServersModal } from './DuplicatedServersModal'; import './ImportServersBtn.scss'; diff --git a/src/servers/helpers/ServerError.tsx b/src/servers/helpers/ServerError.tsx index f133d494..51ece6e1 100644 --- a/src/servers/helpers/ServerError.tsx +++ b/src/servers/helpers/ServerError.tsx @@ -1,9 +1,10 @@ -import { FC } from 'react'; +import type { FC } from 'react'; import { Link } from 'react-router-dom'; import { Message } from '../../utils/Message'; import { ServersListGroup } from '../ServersListGroup'; -import { DeleteServerButtonProps } from '../DeleteServerButton'; -import { isServerWithId, SelectedServer, ServersMap } from '../data'; +import type { DeleteServerButtonProps } from '../DeleteServerButton'; +import type { SelectedServer, ServersMap } from '../data'; +import { isServerWithId } from '../data'; import { NoMenuLayout } from '../../common/NoMenuLayout'; import './ServerError.scss'; diff --git a/src/servers/helpers/ServerForm.tsx b/src/servers/helpers/ServerForm.tsx index 5c781069..54376e86 100644 --- a/src/servers/helpers/ServerForm.tsx +++ b/src/servers/helpers/ServerForm.tsx @@ -1,7 +1,8 @@ -import { FC, PropsWithChildren, ReactNode, useEffect, useState } from 'react'; +import type { FC, PropsWithChildren, ReactNode } from 'react'; +import { useEffect, useState } from 'react'; import { InputFormGroup } from '../../utils/forms/InputFormGroup'; import { handleEventPreventingDefault } from '../../utils/utils'; -import { ServerData } from '../data'; +import type { ServerData } from '../data'; import { SimpleCard } from '../../utils/SimpleCard'; type ServerFormProps = PropsWithChildren<{ diff --git a/src/servers/helpers/withSelectedServer.tsx b/src/servers/helpers/withSelectedServer.tsx index dcd7e228..e5859e11 100644 --- a/src/servers/helpers/withSelectedServer.tsx +++ b/src/servers/helpers/withSelectedServer.tsx @@ -1,7 +1,9 @@ -import { FC, useEffect } from 'react'; +import type { FC } from 'react'; +import { useEffect } from 'react'; import { useParams } from 'react-router-dom'; import { Message } from '../../utils/Message'; -import { isNotFoundServer, SelectedServer } from '../data'; +import type { SelectedServer } from '../data'; +import { isNotFoundServer } from '../data'; import { NoMenuLayout } from '../../common/NoMenuLayout'; interface WithSelectedServerProps { diff --git a/src/servers/helpers/withoutSelectedServer.tsx b/src/servers/helpers/withoutSelectedServer.tsx index c2ee7329..53f5b4c7 100644 --- a/src/servers/helpers/withoutSelectedServer.tsx +++ b/src/servers/helpers/withoutSelectedServer.tsx @@ -1,4 +1,5 @@ -import { FC, useEffect } from 'react'; +import type { FC } from 'react'; +import { useEffect } from 'react'; interface WithoutSelectedServerProps { resetSelectedServer: Function; diff --git a/src/servers/reducers/remoteServers.ts b/src/servers/reducers/remoteServers.ts index 8776441d..ec584527 100644 --- a/src/servers/reducers/remoteServers.ts +++ b/src/servers/reducers/remoteServers.ts @@ -1,8 +1,9 @@ import pack from '../../../package.json'; -import { hasServerData, ServerData } from '../data'; +import type { ServerData } from '../data'; +import { hasServerData } from '../data'; import { createServers } from './servers'; import { createAsyncThunk } from '../../utils/helpers/redux'; -import { HttpClient } from '../../common/services/HttpClient'; +import type { HttpClient } from '../../common/services/HttpClient'; const responseToServersList = (data: any): ServerData[] => (Array.isArray(data) ? data.filter(hasServerData) : []); diff --git a/src/servers/reducers/selectedServer.ts b/src/servers/reducers/selectedServer.ts index b69647f0..341b42a5 100644 --- a/src/servers/reducers/selectedServer.ts +++ b/src/servers/reducers/selectedServer.ts @@ -1,10 +1,12 @@ -import { createAction, createListenerMiddleware, createSlice, PayloadAction } from '@reduxjs/toolkit'; +import type { PayloadAction } from '@reduxjs/toolkit'; +import { createAction, createListenerMiddleware, createSlice } from '@reduxjs/toolkit'; import { memoizeWith, pipe } from 'ramda'; import { versionToPrintable, versionToSemVer as toSemVer } from '../../utils/helpers/version'; -import { isReachableServer, SelectedServer, ServerWithId } from '../data'; -import { ShlinkHealth } from '../../api/types'; +import type { SelectedServer, ServerWithId } from '../data'; +import { isReachableServer } from '../data'; +import type { ShlinkHealth } from '../../api/types'; import { createAsyncThunk } from '../../utils/helpers/redux'; -import { ShlinkApiClientBuilder } from '../../api/services/ShlinkApiClientBuilder'; +import type { ShlinkApiClientBuilder } from '../../api/services/ShlinkApiClientBuilder'; const REDUCER_PREFIX = 'shlink/selectedServer'; diff --git a/src/servers/reducers/servers.ts b/src/servers/reducers/servers.ts index faa2c9c6..2402dc46 100644 --- a/src/servers/reducers/servers.ts +++ b/src/servers/reducers/servers.ts @@ -1,7 +1,8 @@ -import { createSlice, PayloadAction } from '@reduxjs/toolkit'; +import type { PayloadAction } from '@reduxjs/toolkit'; +import { createSlice } from '@reduxjs/toolkit'; import { assoc, dissoc, fromPairs, map, pipe, reduce, toPairs } from 'ramda'; import { v4 as uuid } from 'uuid'; -import { ServerData, ServersMap, ServerWithId } from '../data'; +import type { ServerData, ServersMap, ServerWithId } from '../data'; interface EditServer { serverId: string; diff --git a/src/servers/services/ServersExporter.ts b/src/servers/services/ServersExporter.ts index df4fa680..e12ba7e0 100644 --- a/src/servers/services/ServersExporter.ts +++ b/src/servers/services/ServersExporter.ts @@ -1,8 +1,9 @@ import { values } from 'ramda'; -import { LocalStorage } from '../../utils/services/LocalStorage'; -import { ServersMap, serverWithIdToServerData } from '../data'; +import type { LocalStorage } from '../../utils/services/LocalStorage'; +import type { ServersMap } from '../data'; +import { serverWithIdToServerData } from '../data'; import { saveCsv } from '../../utils/helpers/files'; -import { JsonToCsv } from '../../utils/helpers/csvjson'; +import type { JsonToCsv } from '../../utils/helpers/csvjson'; const SERVERS_FILENAME = 'shlink-servers.csv'; diff --git a/src/servers/services/ServersImporter.ts b/src/servers/services/ServersImporter.ts index 8fb560b7..1705a89d 100644 --- a/src/servers/services/ServersImporter.ts +++ b/src/servers/services/ServersImporter.ts @@ -1,5 +1,5 @@ -import { ServerData } from '../data'; -import { CsvToJson } from '../../utils/helpers/csvjson'; +import type { ServerData } from '../data'; +import type { CsvToJson } from '../../utils/helpers/csvjson'; const validateServer = (server: any): server is ServerData => typeof server.url === 'string' && typeof server.apiKey === 'string' && typeof server.name === 'string'; diff --git a/src/servers/services/provideServices.ts b/src/servers/services/provideServices.ts index 92aaca58..b01905ba 100644 --- a/src/servers/services/provideServices.ts +++ b/src/servers/services/provideServices.ts @@ -1,5 +1,5 @@ import { prop } from 'ramda'; -import Bottle from 'bottlejs'; +import type Bottle from 'bottlejs'; import { CreateServer } from '../CreateServer'; import { ServersDropdown } from '../ServersDropdown'; import { DeleteServerModal } from '../DeleteServerModal'; @@ -15,7 +15,7 @@ import { import { createServers, deleteServer, editServer, setAutoConnect } from '../reducers/servers'; import { fetchServers } from '../reducers/remoteServers'; import { ServerError } from '../helpers/ServerError'; -import { ConnectDecorator } from '../../container/types'; +import type { ConnectDecorator } from '../../container/types'; import { withoutSelectedServer } from '../helpers/withoutSelectedServer'; import { Overview } from '../Overview'; import { ManageServers } from '../ManageServers'; diff --git a/src/settings/RealTimeUpdatesSettings.tsx b/src/settings/RealTimeUpdatesSettings.tsx index f587baa8..20eacf3c 100644 --- a/src/settings/RealTimeUpdatesSettings.tsx +++ b/src/settings/RealTimeUpdatesSettings.tsx @@ -4,7 +4,7 @@ import { ToggleSwitch } from '../utils/ToggleSwitch'; import { SimpleCard } from '../utils/SimpleCard'; import { FormText } from '../utils/forms/FormText'; import { LabeledFormGroup } from '../utils/forms/LabeledFormGroup'; -import { Settings } from './reducers/settings'; +import type { Settings } from './reducers/settings'; import { useDomId } from '../utils/helpers/hooks'; interface RealTimeUpdatesProps { diff --git a/src/settings/Settings.tsx b/src/settings/Settings.tsx index d1c8fd72..d83428cc 100644 --- a/src/settings/Settings.tsx +++ b/src/settings/Settings.tsx @@ -1,4 +1,4 @@ -import { FC, ReactNode } from 'react'; +import type { FC, ReactNode } from 'react'; import { Navigate, Routes, Route } from 'react-router-dom'; import { NoMenuLayout } from '../common/NoMenuLayout'; import { NavPillItem, NavPills } from '../utils/NavPills'; diff --git a/src/settings/ShortUrlCreationSettings.tsx b/src/settings/ShortUrlCreationSettings.tsx index d5523550..1fbffdcf 100644 --- a/src/settings/ShortUrlCreationSettings.tsx +++ b/src/settings/ShortUrlCreationSettings.tsx @@ -1,11 +1,11 @@ -import { FC, ReactNode } from 'react'; +import type { FC, ReactNode } from 'react'; import { DropdownItem, FormGroup } from 'reactstrap'; import { SimpleCard } from '../utils/SimpleCard'; import { ToggleSwitch } from '../utils/ToggleSwitch'; import { DropdownBtn } from '../utils/DropdownBtn'; import { FormText } from '../utils/forms/FormText'; import { LabeledFormGroup } from '../utils/forms/LabeledFormGroup'; -import { Settings, ShortUrlCreationSettings as ShortUrlsSettings, TagFilteringMode } from './reducers/settings'; +import type { Settings, ShortUrlCreationSettings as ShortUrlsSettings, TagFilteringMode } from './reducers/settings'; interface ShortUrlCreationProps { settings: Settings; diff --git a/src/settings/ShortUrlsListSettings.tsx b/src/settings/ShortUrlsListSettings.tsx index bb5f6f8c..57ef8751 100644 --- a/src/settings/ShortUrlsListSettings.tsx +++ b/src/settings/ShortUrlsListSettings.tsx @@ -1,9 +1,10 @@ -import { FC } from 'react'; +import type { FC } from 'react'; import { OrderingDropdown } from '../utils/OrderingDropdown'; import { SHORT_URLS_ORDERABLE_FIELDS } from '../short-urls/data'; import { SimpleCard } from '../utils/SimpleCard'; import { LabeledFormGroup } from '../utils/forms/LabeledFormGroup'; -import { DEFAULT_SHORT_URLS_ORDERING, Settings, ShortUrlsListSettings as ShortUrlsSettings } from './reducers/settings'; +import type { Settings, ShortUrlsListSettings as ShortUrlsSettings } from './reducers/settings'; +import { DEFAULT_SHORT_URLS_ORDERING } from './reducers/settings'; interface ShortUrlsListSettingsProps { settings: Settings; diff --git a/src/settings/TagsSettings.tsx b/src/settings/TagsSettings.tsx index 8cb5631d..46dd5fc3 100644 --- a/src/settings/TagsSettings.tsx +++ b/src/settings/TagsSettings.tsx @@ -1,9 +1,9 @@ -import { FC } from 'react'; +import type { FC } from 'react'; import { SimpleCard } from '../utils/SimpleCard'; import { OrderingDropdown } from '../utils/OrderingDropdown'; import { TAGS_ORDERABLE_FIELDS } from '../tags/data/TagsListChildrenProps'; import { LabeledFormGroup } from '../utils/forms/LabeledFormGroup'; -import { Settings, TagsSettings as TagsSettingsOptions } from './reducers/settings'; +import type { Settings, TagsSettings as TagsSettingsOptions } from './reducers/settings'; interface TagsProps { settings: Settings; diff --git a/src/settings/UserInterfaceSettings.tsx b/src/settings/UserInterfaceSettings.tsx index e21b3460..93ceb9bd 100644 --- a/src/settings/UserInterfaceSettings.tsx +++ b/src/settings/UserInterfaceSettings.tsx @@ -1,10 +1,11 @@ -import { FC } from 'react'; +import type { FC } from 'react'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { faSun, faMoon } from '@fortawesome/free-solid-svg-icons'; import { SimpleCard } from '../utils/SimpleCard'; import { ToggleSwitch } from '../utils/ToggleSwitch'; -import { changeThemeInMarkup, Theme } from '../utils/theme'; -import { Settings, UiSettings } from './reducers/settings'; +import type { Theme } from '../utils/theme'; +import { changeThemeInMarkup } from '../utils/theme'; +import type { Settings, UiSettings } from './reducers/settings'; import './UserInterfaceSettings.scss'; interface UserInterfaceProps { diff --git a/src/settings/VisitsSettings.tsx b/src/settings/VisitsSettings.tsx index a799bd2a..3d1cc951 100644 --- a/src/settings/VisitsSettings.tsx +++ b/src/settings/VisitsSettings.tsx @@ -1,12 +1,12 @@ -import { FC } from 'react'; +import type { FC } from 'react'; import { FormGroup } from 'reactstrap'; import { SimpleCard } from '../utils/SimpleCard'; import { DateIntervalSelector } from '../utils/dates/DateIntervalSelector'; import { LabeledFormGroup } from '../utils/forms/LabeledFormGroup'; -import { Settings, VisitsSettings as VisitsSettingsConfig } from './reducers/settings'; +import type { Settings, VisitsSettings as VisitsSettingsConfig } from './reducers/settings'; import { ToggleSwitch } from '../utils/ToggleSwitch'; import { FormText } from '../utils/forms/FormText'; -import { DateInterval } from '../utils/helpers/dateIntervals'; +import type { DateInterval } from '../utils/helpers/dateIntervals'; interface VisitsProps { settings: Settings; diff --git a/src/settings/helpers/index.ts b/src/settings/helpers/index.ts index 10af7ccd..de01ff55 100644 --- a/src/settings/helpers/index.ts +++ b/src/settings/helpers/index.ts @@ -1,4 +1,4 @@ -import { ShlinkState } from '../../container/types'; +import type { ShlinkState } from '../../container/types'; /* eslint-disable no-param-reassign */ export const migrateDeprecatedSettings = (state: Partial): Partial => { diff --git a/src/settings/reducers/settings.ts b/src/settings/reducers/settings.ts index c8df4c48..35d0ee72 100644 --- a/src/settings/reducers/settings.ts +++ b/src/settings/reducers/settings.ts @@ -1,9 +1,10 @@ -import { createSlice, PayloadAction, PrepareAction } from '@reduxjs/toolkit'; +import type { PayloadAction, PrepareAction } from '@reduxjs/toolkit'; +import { createSlice } from '@reduxjs/toolkit'; import { mergeDeepRight } from 'ramda'; -import { Theme } from '../../utils/theme'; -import { DateInterval } from '../../utils/helpers/dateIntervals'; -import { TagsOrder } from '../../tags/data/TagsListChildrenProps'; -import { ShortUrlsOrder } from '../../short-urls/data'; +import type { Theme } from '../../utils/theme'; +import type { DateInterval } from '../../utils/helpers/dateIntervals'; +import type { TagsOrder } from '../../tags/data/TagsListChildrenProps'; +import type { ShortUrlsOrder } from '../../short-urls/data'; export const DEFAULT_SHORT_URLS_ORDERING: ShortUrlsOrder = { field: 'dateCreated', diff --git a/src/settings/services/provideServices.ts b/src/settings/services/provideServices.ts index d64b8592..723ca573 100644 --- a/src/settings/services/provideServices.ts +++ b/src/settings/services/provideServices.ts @@ -1,4 +1,4 @@ -import Bottle from 'bottlejs'; +import type Bottle from 'bottlejs'; import { RealTimeUpdatesSettings } from '../RealTimeUpdatesSettings'; import { Settings } from '../Settings'; import { @@ -10,7 +10,7 @@ import { setVisitsSettings, toggleRealTimeUpdates, } from '../reducers/settings'; -import { ConnectDecorator } from '../../container/types'; +import type { ConnectDecorator } from '../../container/types'; import { withoutSelectedServer } from '../../servers/helpers/withoutSelectedServer'; import { ShortUrlCreationSettings } from '../ShortUrlCreationSettings'; import { UserInterfaceSettings } from '../UserInterfaceSettings'; diff --git a/src/short-urls/CreateShortUrl.tsx b/src/short-urls/CreateShortUrl.tsx index 2f045023..a863d429 100644 --- a/src/short-urls/CreateShortUrl.tsx +++ b/src/short-urls/CreateShortUrl.tsx @@ -1,10 +1,11 @@ -import { FC, useMemo } from 'react'; -import { SelectedServer } from '../servers/data'; -import { Settings, ShortUrlCreationSettings } from '../settings/reducers/settings'; -import { ShortUrlData } from './data'; -import { ShortUrlCreation } from './reducers/shortUrlCreation'; -import { CreateShortUrlResultProps } from './helpers/CreateShortUrlResult'; -import { ShortUrlFormProps } from './ShortUrlForm'; +import type { FC } from 'react'; +import { useMemo } from 'react'; +import type { SelectedServer } from '../servers/data'; +import type { Settings, ShortUrlCreationSettings } from '../settings/reducers/settings'; +import type { ShortUrlData } from './data'; +import type { ShortUrlCreation } from './reducers/shortUrlCreation'; +import type { CreateShortUrlResultProps } from './helpers/CreateShortUrlResult'; +import type { ShortUrlFormProps } from './ShortUrlForm'; export interface CreateShortUrlProps { basicMode?: boolean; diff --git a/src/short-urls/EditShortUrl.tsx b/src/short-urls/EditShortUrl.tsx index db8c4d43..32477347 100644 --- a/src/short-urls/EditShortUrl.tsx +++ b/src/short-urls/EditShortUrl.tsx @@ -1,20 +1,21 @@ -import { FC, useEffect, useMemo } from 'react'; +import type { FC } from 'react'; +import { useEffect, useMemo } from 'react'; import { Button, Card } from 'reactstrap'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { faArrowLeft } from '@fortawesome/free-solid-svg-icons'; import { ExternalLink } from 'react-external-link'; import { useLocation, useParams } from 'react-router-dom'; -import { SelectedServer } from '../servers/data'; -import { Settings } from '../settings/reducers/settings'; -import { ShortUrlIdentifier } from './data'; +import type { SelectedServer } from '../servers/data'; +import type { Settings } from '../settings/reducers/settings'; +import type { ShortUrlIdentifier } from './data'; import { parseQuery } from '../utils/helpers/query'; import { Message } from '../utils/Message'; import { Result } from '../utils/Result'; import { ShlinkApiError } from '../api/ShlinkApiError'; import { useGoBack } from '../utils/helpers/hooks'; -import { ShortUrlFormProps } from './ShortUrlForm'; -import { ShortUrlDetail } from './reducers/shortUrlDetail'; -import { EditShortUrl as EditShortUrlInfo, ShortUrlEdition } from './reducers/shortUrlEdition'; +import type { ShortUrlFormProps } from './ShortUrlForm'; +import type { ShortUrlDetail } from './reducers/shortUrlDetail'; +import type { EditShortUrl as EditShortUrlInfo, ShortUrlEdition } from './reducers/shortUrlEdition'; import { shortUrlDataFromShortUrl, urlDecodeShortCode } from './helpers'; interface EditShortUrlConnectProps { diff --git a/src/short-urls/Paginator.tsx b/src/short-urls/Paginator.tsx index 5e7d488e..49187440 100644 --- a/src/short-urls/Paginator.tsx +++ b/src/short-urls/Paginator.tsx @@ -1,13 +1,14 @@ import { Link } from 'react-router-dom'; import { Pagination, PaginationItem, PaginationLink } from 'reactstrap'; +import type { + NumberOrEllipsis } from '../utils/helpers/pagination'; import { pageIsEllipsis, keyForPage, progressivePagination, prettifyPageNumber, - NumberOrEllipsis, } from '../utils/helpers/pagination'; -import { ShlinkPaginator } from '../api/types'; +import type { ShlinkPaginator } from '../api/types'; interface PaginatorProps { paginator?: ShlinkPaginator; diff --git a/src/short-urls/ShortUrlForm.tsx b/src/short-urls/ShortUrlForm.tsx index f949de66..85a79c0e 100644 --- a/src/short-urls/ShortUrlForm.tsx +++ b/src/short-urls/ShortUrlForm.tsx @@ -1,19 +1,22 @@ -import { FC, useEffect, useState } from 'react'; -import { InputType } from 'reactstrap/types/lib/Input'; +import type { FC } from 'react'; +import { useEffect, useState } from 'react'; +import type { InputType } from 'reactstrap/types/lib/Input'; import { Button, FormGroup, Input, Row } from 'reactstrap'; import { cond, isEmpty, pipe, replace, trim, T } from 'ramda'; import { parseISO } from 'date-fns'; -import { DateTimeInput, DateTimeInputProps } from '../utils/dates/DateTimeInput'; +import type { DateTimeInputProps } from '../utils/dates/DateTimeInput'; +import { DateTimeInput } from '../utils/dates/DateTimeInput'; import { supportsForwardQuery } from '../utils/helpers/features'; import { SimpleCard } from '../utils/SimpleCard'; -import { handleEventPreventingDefault, hasValue, OptionalString } from '../utils/utils'; +import type { OptionalString } from '../utils/utils'; +import { handleEventPreventingDefault, hasValue } from '../utils/utils'; import { Checkbox } from '../utils/Checkbox'; -import { SelectedServer } from '../servers/data'; -import { TagsSelectorProps } from '../tags/helpers/TagsSelector'; -import { DomainSelectorProps } from '../domains/DomainSelector'; +import type { SelectedServer } from '../servers/data'; +import type { TagsSelectorProps } from '../tags/helpers/TagsSelector'; +import type { DomainSelectorProps } from '../domains/DomainSelector'; import { formatIsoDate } from '../utils/helpers/date'; import { UseExistingIfFoundInfoIcon } from './UseExistingIfFoundInfoIcon'; -import { ShortUrlData } from './data'; +import type { ShortUrlData } from './data'; import { ShortUrlFormCheckboxGroup } from './helpers/ShortUrlFormCheckboxGroup'; import './ShortUrlForm.scss'; diff --git a/src/short-urls/ShortUrlsFilteringBar.tsx b/src/short-urls/ShortUrlsFilteringBar.tsx index b1cdb5a8..785a36f0 100644 --- a/src/short-urls/ShortUrlsFilteringBar.tsx +++ b/src/short-urls/ShortUrlsFilteringBar.tsx @@ -1,4 +1,4 @@ -import { FC } from 'react'; +import type { FC } from 'react'; import { isEmpty, pipe } from 'ramda'; import { Button, InputGroup, Row, UncontrolledTooltip } from 'reactstrap'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; @@ -7,17 +7,19 @@ import classNames from 'classnames'; import { SearchField } from '../utils/SearchField'; import { DateRangeSelector } from '../utils/dates/DateRangeSelector'; import { formatIsoDate } from '../utils/helpers/date'; -import { DateRange, datesToDateRange } from '../utils/helpers/dateIntervals'; +import type { DateRange } from '../utils/helpers/dateIntervals'; +import { datesToDateRange } from '../utils/helpers/dateIntervals'; import { supportsAllTagsFiltering, supportsFilterDisabledUrls } from '../utils/helpers/features'; -import { SelectedServer } from '../servers/data'; -import { OrderDir } from '../utils/helpers/ordering'; +import type { SelectedServer } from '../servers/data'; +import type { OrderDir } from '../utils/helpers/ordering'; import { OrderingDropdown } from '../utils/OrderingDropdown'; import { useShortUrlsQuery } from './helpers/hooks'; -import { SHORT_URLS_ORDERABLE_FIELDS, ShortUrlsOrder, ShortUrlsOrderableFields } from './data'; -import { ExportShortUrlsBtnProps } from './helpers/ExportShortUrlsBtn'; -import { TagsSelectorProps } from '../tags/helpers/TagsSelector'; +import type { ShortUrlsOrder, ShortUrlsOrderableFields } from './data'; +import { SHORT_URLS_ORDERABLE_FIELDS } from './data'; +import type { ExportShortUrlsBtnProps } from './helpers/ExportShortUrlsBtn'; +import type { TagsSelectorProps } from '../tags/helpers/TagsSelector'; import { ShortUrlsFilterDropdown } from './helpers/ShortUrlsFilterDropdown'; -import { Settings } from '../settings/reducers/settings'; +import type { Settings } from '../settings/reducers/settings'; import './ShortUrlsFilteringBar.scss'; interface ShortUrlsFilteringProps { diff --git a/src/short-urls/ShortUrlsList.tsx b/src/short-urls/ShortUrlsList.tsx index b29dc925..c8b27bbc 100644 --- a/src/short-urls/ShortUrlsList.tsx +++ b/src/short-urls/ShortUrlsList.tsx @@ -2,19 +2,22 @@ import { pipe } from 'ramda'; import { useEffect, useState } from 'react'; import { Card } from 'reactstrap'; import { useLocation, useParams } from 'react-router-dom'; -import { determineOrderDir, OrderDir } from '../utils/helpers/ordering'; -import { getServerId, SelectedServer } from '../servers/data'; +import type { OrderDir } from '../utils/helpers/ordering'; +import { determineOrderDir } from '../utils/helpers/ordering'; +import type { SelectedServer } from '../servers/data'; +import { getServerId } from '../servers/data'; import { boundToMercureHub } from '../mercure/helpers/boundToMercureHub'; import { Topics } from '../mercure/helpers/Topics'; import { TableOrderIcon } from '../utils/table/TableOrderIcon'; -import { ShlinkShortUrlsListParams, ShlinkShortUrlsOrder } from '../api/types'; -import { DEFAULT_SHORT_URLS_ORDERING, Settings } from '../settings/reducers/settings'; -import { ShortUrlsList as ShortUrlsListState } from './reducers/shortUrlsList'; -import { ShortUrlsTableType } from './ShortUrlsTable'; +import type { ShlinkShortUrlsListParams, ShlinkShortUrlsOrder } from '../api/types'; +import type { Settings } from '../settings/reducers/settings'; +import { DEFAULT_SHORT_URLS_ORDERING } from '../settings/reducers/settings'; +import type { ShortUrlsList as ShortUrlsListState } from './reducers/shortUrlsList'; +import type { ShortUrlsTableType } from './ShortUrlsTable'; import { Paginator } from './Paginator'; import { useShortUrlsQuery } from './helpers/hooks'; -import { ShortUrlsOrder, ShortUrlsOrderableFields } from './data'; -import { ShortUrlsFilteringBarType } from './ShortUrlsFilteringBar'; +import type { ShortUrlsOrder, ShortUrlsOrderableFields } from './data'; +import type { ShortUrlsFilteringBarType } from './ShortUrlsFilteringBar'; import { supportsExcludeBotsOnShortUrls } from '../utils/helpers/features'; interface ShortUrlsListProps { diff --git a/src/short-urls/ShortUrlsTable.tsx b/src/short-urls/ShortUrlsTable.tsx index 4448af12..e38ccfc0 100644 --- a/src/short-urls/ShortUrlsTable.tsx +++ b/src/short-urls/ShortUrlsTable.tsx @@ -1,10 +1,10 @@ -import { ReactNode } from 'react'; +import type { ReactNode } from 'react'; import { isEmpty } from 'ramda'; import classNames from 'classnames'; -import { SelectedServer } from '../servers/data'; -import { ShortUrlsList as ShortUrlsListState } from './reducers/shortUrlsList'; -import { ShortUrlsRowType } from './helpers/ShortUrlsRow'; -import { ShortUrlsOrderableFields } from './data'; +import type { SelectedServer } from '../servers/data'; +import type { ShortUrlsList as ShortUrlsListState } from './reducers/shortUrlsList'; +import type { ShortUrlsRowType } from './helpers/ShortUrlsRow'; +import type { ShortUrlsOrderableFields } from './data'; import './ShortUrlsTable.scss'; interface ShortUrlsTableProps { diff --git a/src/short-urls/data/index.ts b/src/short-urls/data/index.ts index c0ed41e2..e3b7bac5 100644 --- a/src/short-urls/data/index.ts +++ b/src/short-urls/data/index.ts @@ -1,5 +1,5 @@ -import { Nullable, OptionalString } from '../../utils/utils'; -import { Order } from '../../utils/helpers/ordering'; +import type { Nullable, OptionalString } from '../../utils/utils'; +import type { Order } from '../../utils/helpers/ordering'; export interface EditShortUrlData { longUrl?: string; diff --git a/src/short-urls/helpers/CreateShortUrlResult.tsx b/src/short-urls/helpers/CreateShortUrlResult.tsx index 220eb42f..09939d2d 100644 --- a/src/short-urls/helpers/CreateShortUrlResult.tsx +++ b/src/short-urls/helpers/CreateShortUrlResult.tsx @@ -4,8 +4,8 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { useEffect } from 'react'; import CopyToClipboard from 'react-copy-to-clipboard'; import { Tooltip } from 'reactstrap'; -import { ShortUrlCreation } from '../reducers/shortUrlCreation'; -import { TimeoutToggle } from '../../utils/helpers/hooks'; +import type { ShortUrlCreation } from '../reducers/shortUrlCreation'; +import type { TimeoutToggle } from '../../utils/helpers/hooks'; import { Result } from '../../utils/Result'; import './CreateShortUrlResult.scss'; import { ShlinkApiError } from '../../api/ShlinkApiError'; diff --git a/src/short-urls/helpers/DeleteShortUrlModal.tsx b/src/short-urls/helpers/DeleteShortUrlModal.tsx index e62a946e..2f77d403 100644 --- a/src/short-urls/helpers/DeleteShortUrlModal.tsx +++ b/src/short-urls/helpers/DeleteShortUrlModal.tsx @@ -1,8 +1,8 @@ import { useEffect, useState } from 'react'; import { Modal, ModalBody, ModalFooter, ModalHeader } from 'reactstrap'; import { pipe } from 'ramda'; -import { ShortUrlDeletion } from '../reducers/shortUrlDeletion'; -import { ShortUrlIdentifier, ShortUrlModalProps } from '../data'; +import type { ShortUrlDeletion } from '../reducers/shortUrlDeletion'; +import type { ShortUrlIdentifier, ShortUrlModalProps } from '../data'; import { handleEventPreventingDefault } from '../../utils/utils'; import { Result } from '../../utils/Result'; import { isInvalidDeletionError } from '../../api/utils'; diff --git a/src/short-urls/helpers/ExportShortUrlsBtn.tsx b/src/short-urls/helpers/ExportShortUrlsBtn.tsx index 35403d1d..e38f026c 100644 --- a/src/short-urls/helpers/ExportShortUrlsBtn.tsx +++ b/src/short-urls/helpers/ExportShortUrlsBtn.tsx @@ -1,10 +1,11 @@ -import { FC } from 'react'; +import type { FC } from 'react'; import { ExportBtn } from '../../utils/ExportBtn'; import { useToggle } from '../../utils/helpers/hooks'; -import { ShlinkApiClientBuilder } from '../../api/services/ShlinkApiClientBuilder'; -import { isServerWithId, SelectedServer } from '../../servers/data'; -import { ShortUrl } from '../data'; -import { ReportExporter } from '../../common/services/ReportExporter'; +import type { ShlinkApiClientBuilder } from '../../api/services/ShlinkApiClientBuilder'; +import type { SelectedServer } from '../../servers/data'; +import { isServerWithId } from '../../servers/data'; +import type { ShortUrl } from '../data'; +import type { ReportExporter } from '../../common/services/ReportExporter'; import { useShortUrlsQuery } from './hooks'; export interface ExportShortUrlsBtnProps { diff --git a/src/short-urls/helpers/QrCodeModal.tsx b/src/short-urls/helpers/QrCodeModal.tsx index f4bda9eb..682d3263 100644 --- a/src/short-urls/helpers/QrCodeModal.tsx +++ b/src/short-urls/helpers/QrCodeModal.tsx @@ -3,12 +3,13 @@ import { Modal, FormGroup, ModalBody, ModalHeader, Row, Button } from 'reactstra import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { faFileDownload as downloadIcon } from '@fortawesome/free-solid-svg-icons'; import { ExternalLink } from 'react-external-link'; -import { ShortUrlModalProps } from '../data'; -import { SelectedServer } from '../../servers/data'; +import type { ShortUrlModalProps } from '../data'; +import type { SelectedServer } from '../../servers/data'; import { CopyToClipboardIcon } from '../../utils/CopyToClipboardIcon'; -import { buildQrCodeUrl, QrCodeFormat, QrErrorCorrection } from '../../utils/helpers/qrCodes'; +import type { QrCodeFormat, QrErrorCorrection } from '../../utils/helpers/qrCodes'; +import { buildQrCodeUrl } from '../../utils/helpers/qrCodes'; import { supportsNonRestCors } from '../../utils/helpers/features'; -import { ImageDownloader } from '../../common/services/ImageDownloader'; +import type { ImageDownloader } from '../../common/services/ImageDownloader'; import { QrFormatDropdown } from './qr-codes/QrFormatDropdown'; import { QrErrorCorrectionDropdown } from './qr-codes/QrErrorCorrectionDropdown'; import './QrCodeModal.scss'; diff --git a/src/short-urls/helpers/ShortUrlDetailLink.tsx b/src/short-urls/helpers/ShortUrlDetailLink.tsx index 82adc6ba..89a91726 100644 --- a/src/short-urls/helpers/ShortUrlDetailLink.tsx +++ b/src/short-urls/helpers/ShortUrlDetailLink.tsx @@ -1,7 +1,8 @@ -import { FC } from 'react'; +import type { FC } from 'react'; import { Link } from 'react-router-dom'; -import { isServerWithId, SelectedServer, ServerWithId } from '../../servers/data'; -import { ShortUrl } from '../data'; +import type { SelectedServer, ServerWithId } from '../../servers/data'; +import { isServerWithId } from '../../servers/data'; +import type { ShortUrl } from '../data'; import { urlEncodeShortCode } from './index'; export type LinkSuffix = 'visits' | 'edit'; diff --git a/src/short-urls/helpers/ShortUrlFormCheckboxGroup.tsx b/src/short-urls/helpers/ShortUrlFormCheckboxGroup.tsx index 8d933df5..67e17d79 100644 --- a/src/short-urls/helpers/ShortUrlFormCheckboxGroup.tsx +++ b/src/short-urls/helpers/ShortUrlFormCheckboxGroup.tsx @@ -1,4 +1,4 @@ -import { ChangeEvent, FC, PropsWithChildren } from 'react'; +import type { ChangeEvent, FC, PropsWithChildren } from 'react'; import { Checkbox } from '../../utils/Checkbox'; import { InfoTooltip } from '../../utils/InfoTooltip'; diff --git a/src/short-urls/helpers/ShortUrlStatus.tsx b/src/short-urls/helpers/ShortUrlStatus.tsx index 0803e658..3f02fb6b 100644 --- a/src/short-urls/helpers/ShortUrlStatus.tsx +++ b/src/short-urls/helpers/ShortUrlStatus.tsx @@ -1,10 +1,10 @@ -import { FC, ReactNode } from 'react'; +import type { FC, ReactNode } from 'react'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; -import { IconDefinition } from '@fortawesome/fontawesome-common-types'; +import type { IconDefinition } from '@fortawesome/fontawesome-common-types'; import { faLinkSlash, faCalendarXmark, faCheck } from '@fortawesome/free-solid-svg-icons'; import { UncontrolledTooltip } from 'reactstrap'; import { isBefore } from 'date-fns'; -import { ShortUrl } from '../data'; +import type { ShortUrl } from '../data'; import { formatHumanFriendly, now, parseISO } from '../../utils/helpers/date'; import { useElementRef } from '../../utils/helpers/hooks'; diff --git a/src/short-urls/helpers/ShortUrlVisitsCount.tsx b/src/short-urls/helpers/ShortUrlVisitsCount.tsx index b73cc595..a1e63be5 100644 --- a/src/short-urls/helpers/ShortUrlVisitsCount.tsx +++ b/src/short-urls/helpers/ShortUrlVisitsCount.tsx @@ -3,8 +3,8 @@ import { faInfoCircle as infoIcon } from '@fortawesome/free-solid-svg-icons'; import { UncontrolledTooltip } from 'reactstrap'; import classNames from 'classnames'; import { prettify } from '../../utils/helpers/numbers'; -import { ShortUrl } from '../data'; -import { SelectedServer } from '../../servers/data'; +import type { ShortUrl } from '../data'; +import type { SelectedServer } from '../../servers/data'; import { ShortUrlDetailLink } from './ShortUrlDetailLink'; import { formatHumanFriendly, parseISO } from '../../utils/helpers/date'; import { useElementRef } from '../../utils/helpers/hooks'; diff --git a/src/short-urls/helpers/ShortUrlsFilterDropdown.tsx b/src/short-urls/helpers/ShortUrlsFilterDropdown.tsx index 5d774e1a..3e1366a6 100644 --- a/src/short-urls/helpers/ShortUrlsFilterDropdown.tsx +++ b/src/short-urls/helpers/ShortUrlsFilterDropdown.tsx @@ -1,7 +1,7 @@ import { DropdownItem } from 'reactstrap'; import { DropdownBtn } from '../../utils/DropdownBtn'; import { hasValue } from '../../utils/utils'; -import { ShortUrlsFilter } from '../data'; +import type { ShortUrlsFilter } from '../data'; interface ShortUrlsFilterDropdownProps { onChange: (filters: ShortUrlsFilter) => void; diff --git a/src/short-urls/helpers/ShortUrlsRow.tsx b/src/short-urls/helpers/ShortUrlsRow.tsx index 1104ba83..bbb4104b 100644 --- a/src/short-urls/helpers/ShortUrlsRow.tsx +++ b/src/short-urls/helpers/ShortUrlsRow.tsx @@ -1,14 +1,15 @@ -import { FC, useEffect, useRef } from 'react'; +import type { FC } from 'react'; +import { useEffect, useRef } from 'react'; import { ExternalLink } from 'react-external-link'; -import { ColorGenerator } from '../../utils/services/ColorGenerator'; -import { TimeoutToggle } from '../../utils/helpers/hooks'; -import { SelectedServer } from '../../servers/data'; +import type { ColorGenerator } from '../../utils/services/ColorGenerator'; +import type { TimeoutToggle } from '../../utils/helpers/hooks'; +import type { SelectedServer } from '../../servers/data'; import { CopyToClipboardIcon } from '../../utils/CopyToClipboardIcon'; -import { ShortUrl } from '../data'; +import type { ShortUrl } from '../data'; import { Time } from '../../utils/dates/Time'; -import { Settings } from '../../settings/reducers/settings'; +import type { Settings } from '../../settings/reducers/settings'; import { ShortUrlVisitsCount } from './ShortUrlVisitsCount'; -import { ShortUrlsRowMenuType } from './ShortUrlsRowMenu'; +import type { ShortUrlsRowMenuType } from './ShortUrlsRowMenu'; import { Tags } from './Tags'; import { ShortUrlStatus } from './ShortUrlStatus'; import { useShortUrlsQuery } from './hooks'; diff --git a/src/short-urls/helpers/ShortUrlsRowMenu.tsx b/src/short-urls/helpers/ShortUrlsRowMenu.tsx index 39d32075..b05351fe 100644 --- a/src/short-urls/helpers/ShortUrlsRowMenu.tsx +++ b/src/short-urls/helpers/ShortUrlsRowMenu.tsx @@ -5,11 +5,11 @@ import { faEdit as editIcon, } from '@fortawesome/free-solid-svg-icons'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; -import { FC } from 'react'; +import type { FC } from 'react'; import { DropdownItem } from 'reactstrap'; import { useToggle } from '../../utils/helpers/hooks'; -import { ShortUrl, ShortUrlModalProps } from '../data'; -import { SelectedServer } from '../../servers/data'; +import type { ShortUrl, ShortUrlModalProps } from '../data'; +import type { SelectedServer } from '../../servers/data'; import { DropdownBtnMenu } from '../../utils/DropdownBtnMenu'; import { ShortUrlDetailLink } from './ShortUrlDetailLink'; diff --git a/src/short-urls/helpers/Tags.tsx b/src/short-urls/helpers/Tags.tsx index f95a4511..71f43316 100644 --- a/src/short-urls/helpers/Tags.tsx +++ b/src/short-urls/helpers/Tags.tsx @@ -1,7 +1,7 @@ -import { FC } from 'react'; +import type { FC } from 'react'; import { isEmpty } from 'ramda'; import { Tag } from '../../tags/helpers/Tag'; -import { ColorGenerator } from '../../utils/services/ColorGenerator'; +import type { ColorGenerator } from '../../utils/services/ColorGenerator'; interface TagsProps { tags: string[]; diff --git a/src/short-urls/helpers/hooks.ts b/src/short-urls/helpers/hooks.ts index 95cc5a43..c2dfcdbb 100644 --- a/src/short-urls/helpers/hooks.ts +++ b/src/short-urls/helpers/hooks.ts @@ -2,10 +2,11 @@ import { useParams, useLocation, useNavigate } from 'react-router-dom'; import { useMemo } from 'react'; import { isEmpty, pipe } from 'ramda'; import { parseQuery, stringifyQuery } from '../../utils/helpers/query'; -import { ShortUrlsOrder, ShortUrlsOrderableFields } from '../data'; +import type { ShortUrlsOrder, ShortUrlsOrderableFields } from '../data'; import { orderToString, stringToOrder } from '../../utils/helpers/ordering'; -import { TagsFilteringMode } from '../../api/types'; -import { BooleanString, parseOptionalBooleanToString } from '../../utils/utils'; +import type { TagsFilteringMode } from '../../api/types'; +import type { BooleanString } from '../../utils/utils'; +import { parseOptionalBooleanToString } from '../../utils/utils'; interface ShortUrlsQueryCommon { search?: string; diff --git a/src/short-urls/helpers/index.ts b/src/short-urls/helpers/index.ts index e4dd1f09..4fcfb676 100644 --- a/src/short-urls/helpers/index.ts +++ b/src/short-urls/helpers/index.ts @@ -1,8 +1,8 @@ import { isNil } from 'ramda'; -import { ShortUrl, ShortUrlData } from '../data'; -import { OptionalString } from '../../utils/utils'; +import type { ShortUrl, ShortUrlData } from '../data'; +import type { OptionalString } from '../../utils/utils'; import { DEFAULT_DOMAIN } from '../../visits/reducers/domainVisits'; -import { ShortUrlCreationSettings } from '../../settings/reducers/settings'; +import type { ShortUrlCreationSettings } from '../../settings/reducers/settings'; export const shortUrlMatches = (shortUrl: ShortUrl, shortCode: string, domain: OptionalString): boolean => { if (isNil(domain)) { diff --git a/src/short-urls/helpers/qr-codes/QrErrorCorrectionDropdown.tsx b/src/short-urls/helpers/qr-codes/QrErrorCorrectionDropdown.tsx index b6fd68b7..81673261 100644 --- a/src/short-urls/helpers/qr-codes/QrErrorCorrectionDropdown.tsx +++ b/src/short-urls/helpers/qr-codes/QrErrorCorrectionDropdown.tsx @@ -1,7 +1,7 @@ -import { FC } from 'react'; +import type { FC } from 'react'; import { DropdownItem } from 'reactstrap'; import { DropdownBtn } from '../../../utils/DropdownBtn'; -import { QrErrorCorrection } from '../../../utils/helpers/qrCodes'; +import type { QrErrorCorrection } from '../../../utils/helpers/qrCodes'; interface QrErrorCorrectionDropdownProps { errorCorrection: QrErrorCorrection; diff --git a/src/short-urls/helpers/qr-codes/QrFormatDropdown.tsx b/src/short-urls/helpers/qr-codes/QrFormatDropdown.tsx index 3c9ca705..c7170b9c 100644 --- a/src/short-urls/helpers/qr-codes/QrFormatDropdown.tsx +++ b/src/short-urls/helpers/qr-codes/QrFormatDropdown.tsx @@ -1,7 +1,7 @@ -import { FC } from 'react'; +import type { FC } from 'react'; import { DropdownItem } from 'reactstrap'; import { DropdownBtn } from '../../../utils/DropdownBtn'; -import { QrCodeFormat } from '../../../utils/helpers/qrCodes'; +import type { QrCodeFormat } from '../../../utils/helpers/qrCodes'; interface QrFormatDropdownProps { format: QrCodeFormat; diff --git a/src/short-urls/reducers/shortUrlCreation.ts b/src/short-urls/reducers/shortUrlCreation.ts index 1a48b63e..a6185983 100644 --- a/src/short-urls/reducers/shortUrlCreation.ts +++ b/src/short-urls/reducers/shortUrlCreation.ts @@ -1,9 +1,10 @@ -import { createSlice, PayloadAction } from '@reduxjs/toolkit'; -import { ShortUrl, ShortUrlData } from '../data'; +import type { PayloadAction } from '@reduxjs/toolkit'; +import { createSlice } from '@reduxjs/toolkit'; +import type { ShortUrl, ShortUrlData } from '../data'; import { createAsyncThunk } from '../../utils/helpers/redux'; -import { ShlinkApiClientBuilder } from '../../api/services/ShlinkApiClientBuilder'; +import type { ShlinkApiClientBuilder } from '../../api/services/ShlinkApiClientBuilder'; import { parseApiError } from '../../api/utils'; -import { ProblemDetailsError } from '../../api/types/errors'; +import type { ProblemDetailsError } from '../../api/types/errors'; const REDUCER_PREFIX = 'shlink/shortUrlCreation'; diff --git a/src/short-urls/reducers/shortUrlDeletion.ts b/src/short-urls/reducers/shortUrlDeletion.ts index 294e1986..f619d442 100644 --- a/src/short-urls/reducers/shortUrlDeletion.ts +++ b/src/short-urls/reducers/shortUrlDeletion.ts @@ -1,9 +1,9 @@ import { createAction, createSlice } from '@reduxjs/toolkit'; import { createAsyncThunk } from '../../utils/helpers/redux'; -import { ShlinkApiClientBuilder } from '../../api/services/ShlinkApiClientBuilder'; +import type { ShlinkApiClientBuilder } from '../../api/services/ShlinkApiClientBuilder'; import { parseApiError } from '../../api/utils'; -import { ProblemDetailsError } from '../../api/types/errors'; -import { ShortUrl, ShortUrlIdentifier } from '../data'; +import type { ProblemDetailsError } from '../../api/types/errors'; +import type { ShortUrl, ShortUrlIdentifier } from '../data'; const REDUCER_PREFIX = 'shlink/shortUrlDeletion'; diff --git a/src/short-urls/reducers/shortUrlDetail.ts b/src/short-urls/reducers/shortUrlDetail.ts index 4ad467f3..cc54ab2c 100644 --- a/src/short-urls/reducers/shortUrlDetail.ts +++ b/src/short-urls/reducers/shortUrlDetail.ts @@ -1,10 +1,11 @@ -import { createSlice, PayloadAction } from '@reduxjs/toolkit'; -import { ShortUrl, ShortUrlIdentifier } from '../data'; +import type { PayloadAction } from '@reduxjs/toolkit'; +import { createSlice } from '@reduxjs/toolkit'; +import type { ShortUrl, ShortUrlIdentifier } from '../data'; import { createAsyncThunk } from '../../utils/helpers/redux'; -import { ShlinkApiClientBuilder } from '../../api/services/ShlinkApiClientBuilder'; +import type { ShlinkApiClientBuilder } from '../../api/services/ShlinkApiClientBuilder'; import { shortUrlMatches } from '../helpers'; import { parseApiError } from '../../api/utils'; -import { ProblemDetailsError } from '../../api/types/errors'; +import type { ProblemDetailsError } from '../../api/types/errors'; const REDUCER_PREFIX = 'shlink/shortUrlDetail'; diff --git a/src/short-urls/reducers/shortUrlEdition.ts b/src/short-urls/reducers/shortUrlEdition.ts index 79ea145d..da707cc9 100644 --- a/src/short-urls/reducers/shortUrlEdition.ts +++ b/src/short-urls/reducers/shortUrlEdition.ts @@ -1,9 +1,10 @@ -import { createSlice, PayloadAction } from '@reduxjs/toolkit'; +import type { PayloadAction } from '@reduxjs/toolkit'; +import { createSlice } from '@reduxjs/toolkit'; import { createAsyncThunk } from '../../utils/helpers/redux'; -import { EditShortUrlData, ShortUrl, ShortUrlIdentifier } from '../data'; -import { ShlinkApiClientBuilder } from '../../api/services/ShlinkApiClientBuilder'; +import type { EditShortUrlData, ShortUrl, ShortUrlIdentifier } from '../data'; +import type { ShlinkApiClientBuilder } from '../../api/services/ShlinkApiClientBuilder'; import { parseApiError } from '../../api/utils'; -import { ProblemDetailsError } from '../../api/types/errors'; +import type { ProblemDetailsError } from '../../api/types/errors'; const REDUCER_PREFIX = 'shlink/shortUrlEdition'; diff --git a/src/short-urls/reducers/shortUrlsList.ts b/src/short-urls/reducers/shortUrlsList.ts index 5b8d52b1..220776e0 100644 --- a/src/short-urls/reducers/shortUrlsList.ts +++ b/src/short-urls/reducers/shortUrlsList.ts @@ -3,12 +3,12 @@ import { assocPath, last, pipe, reject } from 'ramda'; import { shortUrlMatches } from '../helpers'; import { createNewVisits } from '../../visits/reducers/visitCreation'; import { createAsyncThunk } from '../../utils/helpers/redux'; -import { ShlinkApiClientBuilder } from '../../api/services/ShlinkApiClientBuilder'; -import { ShlinkShortUrlsListParams, ShlinkShortUrlsResponse } from '../../api/types'; +import type { ShlinkApiClientBuilder } from '../../api/services/ShlinkApiClientBuilder'; +import type { ShlinkShortUrlsListParams, ShlinkShortUrlsResponse } from '../../api/types'; import { shortUrlDeleted } from './shortUrlDeletion'; -import { createShortUrl } from './shortUrlCreation'; -import { editShortUrl } from './shortUrlEdition'; -import { ShortUrl } from '../data'; +import type { createShortUrl } from './shortUrlCreation'; +import type { editShortUrl } from './shortUrlEdition'; +import type { ShortUrl } from '../data'; const REDUCER_PREFIX = 'shlink/shortUrlsList'; export const ITEMS_IN_OVERVIEW_PAGE = 5; diff --git a/src/short-urls/services/provideServices.ts b/src/short-urls/services/provideServices.ts index 185ab81e..054753d3 100644 --- a/src/short-urls/services/provideServices.ts +++ b/src/short-urls/services/provideServices.ts @@ -1,4 +1,4 @@ -import Bottle from 'bottlejs'; +import type Bottle from 'bottlejs'; import { prop } from 'ramda'; import { ShortUrlsFilteringBar } from '../ShortUrlsFilteringBar'; import { ShortUrlsList } from '../ShortUrlsList'; @@ -12,7 +12,7 @@ import { shortUrlCreationReducerCreator, createShortUrl } from '../reducers/shor import { shortUrlDeletionReducerCreator, deleteShortUrl, shortUrlDeleted } from '../reducers/shortUrlDeletion'; import { editShortUrl, shortUrlEditionReducerCreator } from '../reducers/shortUrlEdition'; import { shortUrlDetailReducerCreator } from '../reducers/shortUrlDetail'; -import { ConnectDecorator } from '../../container/types'; +import type { ConnectDecorator } from '../../container/types'; import { ShortUrlsTable } from '../ShortUrlsTable'; import { ShortUrlForm } from '../ShortUrlForm'; import { EditShortUrl } from '../EditShortUrl'; diff --git a/src/tags/TagsList.tsx b/src/tags/TagsList.tsx index be35f153..55b46844 100644 --- a/src/tags/TagsList.tsx +++ b/src/tags/TagsList.tsx @@ -1,20 +1,22 @@ -import { FC, useEffect, useState } from 'react'; +import type { FC } from 'react'; +import { useEffect, useState } from 'react'; import { Row } from 'reactstrap'; import { pipe } from 'ramda'; import { Message } from '../utils/Message'; import { SearchField } from '../utils/SearchField'; -import { SelectedServer } from '../servers/data'; +import type { SelectedServer } from '../servers/data'; import { boundToMercureHub } from '../mercure/helpers/boundToMercureHub'; import { Result } from '../utils/Result'; import { ShlinkApiError } from '../api/ShlinkApiError'; import { Topics } from '../mercure/helpers/Topics'; -import { Settings } from '../settings/reducers/settings'; +import type { Settings } from '../settings/reducers/settings'; import { determineOrderDir, sortList } from '../utils/helpers/ordering'; import { OrderingDropdown } from '../utils/OrderingDropdown'; -import { TagsList as TagsListState } from './reducers/tagsList'; -import { TagsOrderableFields, TAGS_ORDERABLE_FIELDS, TagsOrder } from './data/TagsListChildrenProps'; -import { NormalizedTag } from './data'; -import { TagsTableProps } from './TagsTable'; +import type { TagsList as TagsListState } from './reducers/tagsList'; +import type { TagsOrderableFields, TagsOrder } from './data/TagsListChildrenProps'; +import { TAGS_ORDERABLE_FIELDS } from './data/TagsListChildrenProps'; +import type { NormalizedTag } from './data'; +import type { TagsTableProps } from './TagsTable'; export interface TagsListProps { filterTags: (searchTerm: string) => void; diff --git a/src/tags/TagsTable.tsx b/src/tags/TagsTable.tsx index 205196e8..71952f32 100644 --- a/src/tags/TagsTable.tsx +++ b/src/tags/TagsTable.tsx @@ -1,4 +1,5 @@ -import { FC, useEffect, useRef } from 'react'; +import type { FC } from 'react'; +import { useEffect, useRef } from 'react'; import { splitEvery } from 'ramda'; import { useLocation } from 'react-router-dom'; import { SimpleCard } from '../utils/SimpleCard'; @@ -6,8 +7,8 @@ import { SimplePaginator } from '../common/SimplePaginator'; import { useQueryState } from '../utils/helpers/hooks'; import { parseQuery } from '../utils/helpers/query'; import { TableOrderIcon } from '../utils/table/TableOrderIcon'; -import { TagsOrderableFields, TagsListChildrenProps, TagsOrder } from './data/TagsListChildrenProps'; -import { TagsTableRowProps } from './TagsTableRow'; +import type { TagsOrderableFields, TagsListChildrenProps, TagsOrder } from './data/TagsListChildrenProps'; +import type { TagsTableRowProps } from './TagsTableRow'; import './TagsTable.scss'; export interface TagsTableProps extends TagsListChildrenProps { diff --git a/src/tags/TagsTableRow.tsx b/src/tags/TagsTableRow.tsx index 1bad323e..c3e100b2 100644 --- a/src/tags/TagsTableRow.tsx +++ b/src/tags/TagsTableRow.tsx @@ -1,15 +1,16 @@ -import { FC } from 'react'; +import type { FC } from 'react'; import { Link } from 'react-router-dom'; import { DropdownItem } from 'reactstrap'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { faTrash as deleteIcon, faPencilAlt as editIcon } from '@fortawesome/free-solid-svg-icons'; -import { getServerId, SelectedServer } from '../servers/data'; -import { ColorGenerator } from '../utils/services/ColorGenerator'; +import type { SelectedServer } from '../servers/data'; +import { getServerId } from '../servers/data'; +import type { ColorGenerator } from '../utils/services/ColorGenerator'; import { prettify } from '../utils/helpers/numbers'; import { useToggle } from '../utils/helpers/hooks'; import { DropdownBtnMenu } from '../utils/DropdownBtnMenu'; import { TagBullet } from './helpers/TagBullet'; -import { NormalizedTag, TagModalProps } from './data'; +import type { NormalizedTag, TagModalProps } from './data'; export interface TagsTableRowProps { tag: NormalizedTag; diff --git a/src/tags/data/TagsListChildrenProps.ts b/src/tags/data/TagsListChildrenProps.ts index 54837ac7..a20720bc 100644 --- a/src/tags/data/TagsListChildrenProps.ts +++ b/src/tags/data/TagsListChildrenProps.ts @@ -1,6 +1,6 @@ -import { SelectedServer } from '../../servers/data'; -import { Order } from '../../utils/helpers/ordering'; -import { NormalizedTag } from './index'; +import type { SelectedServer } from '../../servers/data'; +import type { Order } from '../../utils/helpers/ordering'; +import type { NormalizedTag } from './index'; export const TAGS_ORDERABLE_FIELDS = { tag: 'Tag', diff --git a/src/tags/helpers/DeleteTagConfirmModal.tsx b/src/tags/helpers/DeleteTagConfirmModal.tsx index fd2cbfdb..5ac400a3 100644 --- a/src/tags/helpers/DeleteTagConfirmModal.tsx +++ b/src/tags/helpers/DeleteTagConfirmModal.tsx @@ -1,6 +1,6 @@ import { Button, Modal, ModalBody, ModalFooter, ModalHeader } from 'reactstrap'; -import { TagDeletion } from '../reducers/tagDelete'; -import { TagModalProps } from '../data'; +import type { TagDeletion } from '../reducers/tagDelete'; +import type { TagModalProps } from '../data'; import { Result } from '../../utils/Result'; import { ShlinkApiError } from '../../api/ShlinkApiError'; diff --git a/src/tags/helpers/EditTagModal.tsx b/src/tags/helpers/EditTagModal.tsx index 06dbefe5..3dedd963 100644 --- a/src/tags/helpers/EditTagModal.tsx +++ b/src/tags/helpers/EditTagModal.tsx @@ -6,9 +6,9 @@ import { faPalette as colorIcon } from '@fortawesome/free-solid-svg-icons'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { useToggle } from '../../utils/helpers/hooks'; import { handleEventPreventingDefault } from '../../utils/utils'; -import { ColorGenerator } from '../../utils/services/ColorGenerator'; -import { TagModalProps } from '../data'; -import { EditTag, TagEdition } from '../reducers/tagEdit'; +import type { ColorGenerator } from '../../utils/services/ColorGenerator'; +import type { TagModalProps } from '../data'; +import type { EditTag, TagEdition } from '../reducers/tagEdit'; import { Result } from '../../utils/Result'; import { ShlinkApiError } from '../../api/ShlinkApiError'; import './EditTagModal.scss'; diff --git a/src/tags/helpers/Tag.tsx b/src/tags/helpers/Tag.tsx index 61ab3057..771ecbd9 100644 --- a/src/tags/helpers/Tag.tsx +++ b/src/tags/helpers/Tag.tsx @@ -1,6 +1,6 @@ -import { FC, MouseEventHandler, PropsWithChildren } from 'react'; +import type { FC, MouseEventHandler, PropsWithChildren } from 'react'; import classNames from 'classnames'; -import { ColorGenerator } from '../../utils/services/ColorGenerator'; +import type { ColorGenerator } from '../../utils/services/ColorGenerator'; import './Tag.scss'; type TagProps = PropsWithChildren<{ diff --git a/src/tags/helpers/TagBullet.tsx b/src/tags/helpers/TagBullet.tsx index dc84f729..0c303571 100644 --- a/src/tags/helpers/TagBullet.tsx +++ b/src/tags/helpers/TagBullet.tsx @@ -1,4 +1,4 @@ -import { ColorGenerator } from '../../utils/services/ColorGenerator'; +import type { ColorGenerator } from '../../utils/services/ColorGenerator'; import './TagBullet.scss'; interface TagBulletProps { diff --git a/src/tags/helpers/TagsSelector.tsx b/src/tags/helpers/TagsSelector.tsx index 3d785af3..b1a929d4 100644 --- a/src/tags/helpers/TagsSelector.tsx +++ b/src/tags/helpers/TagsSelector.tsx @@ -1,8 +1,9 @@ import { useEffect } from 'react'; -import ReactTags, { SuggestionComponentProps, TagComponentProps } from 'react-tag-autocomplete'; -import { ColorGenerator } from '../../utils/services/ColorGenerator'; -import { Settings } from '../../settings/reducers/settings'; -import { TagsList } from '../reducers/tagsList'; +import type { SuggestionComponentProps, TagComponentProps } from 'react-tag-autocomplete'; +import ReactTags from 'react-tag-autocomplete'; +import type { ColorGenerator } from '../../utils/services/ColorGenerator'; +import type { Settings } from '../../settings/reducers/settings'; +import type { TagsList } from '../reducers/tagsList'; import { TagBullet } from './TagBullet'; import { Tag } from './Tag'; diff --git a/src/tags/reducers/tagDelete.ts b/src/tags/reducers/tagDelete.ts index 5bac50a8..4a7a3e90 100644 --- a/src/tags/reducers/tagDelete.ts +++ b/src/tags/reducers/tagDelete.ts @@ -1,8 +1,8 @@ import { createAction, createSlice } from '@reduxjs/toolkit'; import { createAsyncThunk } from '../../utils/helpers/redux'; -import { ShlinkApiClientBuilder } from '../../api/services/ShlinkApiClientBuilder'; +import type { ShlinkApiClientBuilder } from '../../api/services/ShlinkApiClientBuilder'; import { parseApiError } from '../../api/utils'; -import { ProblemDetailsError } from '../../api/types/errors'; +import type { ProblemDetailsError } from '../../api/types/errors'; const REDUCER_PREFIX = 'shlink/tagDelete'; diff --git a/src/tags/reducers/tagEdit.ts b/src/tags/reducers/tagEdit.ts index 675f8898..13ee61f6 100644 --- a/src/tags/reducers/tagEdit.ts +++ b/src/tags/reducers/tagEdit.ts @@ -1,10 +1,11 @@ import { pick } from 'ramda'; -import { createAction, createSlice, PayloadAction } from '@reduxjs/toolkit'; +import type { PayloadAction } from '@reduxjs/toolkit'; +import { createAction, createSlice } from '@reduxjs/toolkit'; import { createAsyncThunk } from '../../utils/helpers/redux'; -import { ColorGenerator } from '../../utils/services/ColorGenerator'; -import { ShlinkApiClientBuilder } from '../../api/services/ShlinkApiClientBuilder'; +import type { ColorGenerator } from '../../utils/services/ColorGenerator'; +import type { ShlinkApiClientBuilder } from '../../api/services/ShlinkApiClientBuilder'; import { parseApiError } from '../../api/utils'; -import { ProblemDetailsError } from '../../api/types/errors'; +import type { ProblemDetailsError } from '../../api/types/errors'; const REDUCER_PREFIX = 'shlink/tagEdit'; diff --git a/src/tags/reducers/tagsList.ts b/src/tags/reducers/tagsList.ts index d348674c..4dea9d2f 100644 --- a/src/tags/reducers/tagsList.ts +++ b/src/tags/reducers/tagsList.ts @@ -2,15 +2,15 @@ import { createAction, createSlice } from '@reduxjs/toolkit'; import { isEmpty, reject } from 'ramda'; import { createNewVisits } from '../../visits/reducers/visitCreation'; import { createAsyncThunk } from '../../utils/helpers/redux'; -import { ShlinkTags } from '../../api/types'; -import { ShlinkApiClientBuilder } from '../../api/services/ShlinkApiClientBuilder'; -import { CreateVisit, Stats } from '../../visits/types'; +import type { ShlinkTags } from '../../api/types'; +import type { ShlinkApiClientBuilder } from '../../api/services/ShlinkApiClientBuilder'; +import type { CreateVisit, Stats } from '../../visits/types'; import { parseApiError } from '../../api/utils'; -import { TagStats } from '../data'; -import { createShortUrl } from '../../short-urls/reducers/shortUrlCreation'; +import type { TagStats } from '../data'; +import type { createShortUrl } from '../../short-urls/reducers/shortUrlCreation'; import { tagDeleted } from './tagDelete'; import { tagEdited } from './tagEdit'; -import { ProblemDetailsError } from '../../api/types/errors'; +import type { ProblemDetailsError } from '../../api/types/errors'; const REDUCER_PREFIX = 'shlink/tagsList'; diff --git a/src/tags/services/provideServices.ts b/src/tags/services/provideServices.ts index 0fbda139..7fa9cc83 100644 --- a/src/tags/services/provideServices.ts +++ b/src/tags/services/provideServices.ts @@ -1,5 +1,6 @@ import { prop } from 'ramda'; -import Bottle, { IContainer } from 'bottlejs'; +import type { IContainer } from 'bottlejs'; +import type Bottle from 'bottlejs'; import { TagsSelector } from '../helpers/TagsSelector'; import { DeleteTagConfirmModal } from '../helpers/DeleteTagConfirmModal'; import { EditTagModal } from '../helpers/EditTagModal'; @@ -7,7 +8,7 @@ import { TagsList } from '../TagsList'; import { filterTags, listTags, tagsListReducerCreator } from '../reducers/tagsList'; import { tagDeleted, tagDeleteReducerCreator } from '../reducers/tagDelete'; import { editTag, tagEdited, tagEditReducerCreator } from '../reducers/tagEdit'; -import { ConnectDecorator } from '../../container/types'; +import type { ConnectDecorator } from '../../container/types'; import { TagsTable } from '../TagsTable'; import { TagsTableRow } from '../TagsTableRow'; diff --git a/src/utils/BooleanControl.tsx b/src/utils/BooleanControl.tsx index fd93a8d0..e66418cc 100644 --- a/src/utils/BooleanControl.tsx +++ b/src/utils/BooleanControl.tsx @@ -1,4 +1,4 @@ -import { ChangeEvent, FC, PropsWithChildren } from 'react'; +import type { ChangeEvent, FC, PropsWithChildren } from 'react'; import classNames from 'classnames'; import { identity } from 'ramda'; import { useDomId } from './helpers/hooks'; diff --git a/src/utils/Checkbox.tsx b/src/utils/Checkbox.tsx index 4e4ef083..fc61a7e1 100644 --- a/src/utils/Checkbox.tsx +++ b/src/utils/Checkbox.tsx @@ -1,4 +1,5 @@ -import { FC } from 'react'; -import { BooleanControl, BooleanControlProps } from './BooleanControl'; +import type { FC } from 'react'; +import type { BooleanControlProps } from './BooleanControl'; +import { BooleanControl } from './BooleanControl'; export const Checkbox: FC = (props) => ; diff --git a/src/utils/CopyToClipboardIcon.tsx b/src/utils/CopyToClipboardIcon.tsx index 79359a12..314af944 100644 --- a/src/utils/CopyToClipboardIcon.tsx +++ b/src/utils/CopyToClipboardIcon.tsx @@ -1,4 +1,4 @@ -import { FC } from 'react'; +import type { FC } from 'react'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { faCopy as copyIcon } from '@fortawesome/free-regular-svg-icons'; import CopyToClipboard from 'react-copy-to-clipboard'; diff --git a/src/utils/DropdownBtn.tsx b/src/utils/DropdownBtn.tsx index 6bfe82cd..08e0ef4d 100644 --- a/src/utils/DropdownBtn.tsx +++ b/src/utils/DropdownBtn.tsx @@ -1,4 +1,4 @@ -import { FC, PropsWithChildren } from 'react'; +import type { FC, PropsWithChildren } from 'react'; import { Dropdown, DropdownMenu, DropdownToggle } from 'reactstrap'; import { useToggle } from './helpers/hooks'; import './DropdownBtn.scss'; diff --git a/src/utils/DropdownBtnMenu.tsx b/src/utils/DropdownBtnMenu.tsx index 694ccb89..cd62f0b5 100644 --- a/src/utils/DropdownBtnMenu.tsx +++ b/src/utils/DropdownBtnMenu.tsx @@ -1,4 +1,4 @@ -import { FC, PropsWithChildren } from 'react'; +import type { FC, PropsWithChildren } from 'react'; import { ButtonDropdown, DropdownMenu, DropdownToggle } from 'reactstrap'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { faEllipsisV as menuIcon } from '@fortawesome/free-solid-svg-icons'; diff --git a/src/utils/ExportBtn.tsx b/src/utils/ExportBtn.tsx index c6f141bb..42af9e57 100644 --- a/src/utils/ExportBtn.tsx +++ b/src/utils/ExportBtn.tsx @@ -1,5 +1,6 @@ -import { FC } from 'react'; -import { Button, ButtonProps } from 'reactstrap'; +import type { FC } from 'react'; +import type { ButtonProps } from 'reactstrap'; +import { Button } from 'reactstrap'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { faFileCsv } from '@fortawesome/free-solid-svg-icons'; import { prettify } from './helpers/numbers'; diff --git a/src/utils/InfoTooltip.tsx b/src/utils/InfoTooltip.tsx index 9d2eaa28..9e8103c4 100644 --- a/src/utils/InfoTooltip.tsx +++ b/src/utils/InfoTooltip.tsx @@ -1,8 +1,8 @@ -import { FC, PropsWithChildren } from 'react'; +import type { FC, PropsWithChildren } from 'react'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { faInfoCircle as infoIcon } from '@fortawesome/free-solid-svg-icons'; import { UncontrolledTooltip } from 'reactstrap'; -import { Placement } from '@popperjs/core'; +import type { Placement } from '@popperjs/core'; import { useElementRef } from './helpers/hooks'; export type InfoTooltipProps = PropsWithChildren<{ diff --git a/src/utils/Message.tsx b/src/utils/Message.tsx index e171e93c..2c166752 100644 --- a/src/utils/Message.tsx +++ b/src/utils/Message.tsx @@ -1,4 +1,4 @@ -import { FC, PropsWithChildren } from 'react'; +import type { FC, PropsWithChildren } from 'react'; import { Card, Row } from 'reactstrap'; import classNames from 'classnames'; import { faCircleNotch as preloader } from '@fortawesome/free-solid-svg-icons'; diff --git a/src/utils/NavPills.tsx b/src/utils/NavPills.tsx index 4eaf3f17..e08b6469 100644 --- a/src/utils/NavPills.tsx +++ b/src/utils/NavPills.tsx @@ -1,4 +1,5 @@ -import { FC, Children, isValidElement, PropsWithChildren } from 'react'; +import type { FC, PropsWithChildren } from 'react'; +import { Children, isValidElement } from 'react'; import { Card, Nav, NavLink } from 'reactstrap'; import { NavLink as RouterNavLink } from 'react-router-dom'; import './NavPills.scss'; diff --git a/src/utils/OrderingDropdown.tsx b/src/utils/OrderingDropdown.tsx index 71afb672..254dcd4a 100644 --- a/src/utils/OrderingDropdown.tsx +++ b/src/utils/OrderingDropdown.tsx @@ -3,7 +3,8 @@ import { toPairs } from 'ramda'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { faSortAmountUp as sortAscIcon, faSortAmountDown as sortDescIcon } from '@fortawesome/free-solid-svg-icons'; import classNames from 'classnames'; -import { determineOrderDir, Order, OrderDir } from './helpers/ordering'; +import type { Order, OrderDir } from './helpers/ordering'; +import { determineOrderDir } from './helpers/ordering'; import './OrderingDropdown.scss'; export interface OrderingDropdownProps { diff --git a/src/utils/Result.tsx b/src/utils/Result.tsx index e32872a8..fe7a7564 100644 --- a/src/utils/Result.tsx +++ b/src/utils/Result.tsx @@ -1,4 +1,4 @@ -import { FC, PropsWithChildren } from 'react'; +import type { FC, PropsWithChildren } from 'react'; import { Row } from 'reactstrap'; import classNames from 'classnames'; import { SimpleCard } from './SimpleCard'; diff --git a/src/utils/SimpleCard.tsx b/src/utils/SimpleCard.tsx index 2243037b..12061c4c 100644 --- a/src/utils/SimpleCard.tsx +++ b/src/utils/SimpleCard.tsx @@ -1,5 +1,6 @@ -import { Card, CardBody, CardHeader, CardProps } from 'reactstrap'; -import { ReactNode } from 'react'; +import type { CardProps } from 'reactstrap'; +import { Card, CardBody, CardHeader } from 'reactstrap'; +import type { ReactNode } from 'react'; interface SimpleCardProps extends Omit { title?: ReactNode; diff --git a/src/utils/ToggleSwitch.tsx b/src/utils/ToggleSwitch.tsx index 797e9b5d..b9cc6b96 100644 --- a/src/utils/ToggleSwitch.tsx +++ b/src/utils/ToggleSwitch.tsx @@ -1,4 +1,5 @@ -import { FC } from 'react'; -import { BooleanControl, BooleanControlProps } from './BooleanControl'; +import type { FC } from 'react'; +import type { BooleanControlProps } from './BooleanControl'; +import { BooleanControl } from './BooleanControl'; export const ToggleSwitch: FC = (props) => ; diff --git a/src/utils/dates/DateInput.tsx b/src/utils/dates/DateInput.tsx index 15a95851..9bc653ea 100644 --- a/src/utils/dates/DateInput.tsx +++ b/src/utils/dates/DateInput.tsx @@ -1,6 +1,7 @@ import { useRef } from 'react'; import { isNil } from 'ramda'; -import DatePicker, { ReactDatePickerProps } from 'react-datepicker'; +import type { ReactDatePickerProps } from 'react-datepicker'; +import DatePicker from 'react-datepicker'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { faCalendarAlt as calendarIcon } from '@fortawesome/free-regular-svg-icons'; import classNames from 'classnames'; diff --git a/src/utils/dates/DateIntervalDropdownItems.tsx b/src/utils/dates/DateIntervalDropdownItems.tsx index bd2b8de4..0e3d59cd 100644 --- a/src/utils/dates/DateIntervalDropdownItems.tsx +++ b/src/utils/dates/DateIntervalDropdownItems.tsx @@ -1,6 +1,7 @@ import { DropdownItem } from 'reactstrap'; -import { FC } from 'react'; -import { DATE_INTERVALS, DateInterval, rangeOrIntervalToString } from '../helpers/dateIntervals'; +import type { FC } from 'react'; +import type { DateInterval } from '../helpers/dateIntervals'; +import { DATE_INTERVALS, rangeOrIntervalToString } from '../helpers/dateIntervals'; export interface DateIntervalDropdownProps { active?: DateInterval; diff --git a/src/utils/dates/DateIntervalSelector.tsx b/src/utils/dates/DateIntervalSelector.tsx index 3f4bccb3..094eb298 100644 --- a/src/utils/dates/DateIntervalSelector.tsx +++ b/src/utils/dates/DateIntervalSelector.tsx @@ -1,7 +1,8 @@ -import { FC } from 'react'; +import type { FC } from 'react'; import { DropdownBtn } from '../DropdownBtn'; import { rangeOrIntervalToString } from '../helpers/dateIntervals'; -import { DateIntervalDropdownItems, DateIntervalDropdownProps } from './DateIntervalDropdownItems'; +import type { DateIntervalDropdownProps } from './DateIntervalDropdownItems'; +import { DateIntervalDropdownItems } from './DateIntervalDropdownItems'; export const DateIntervalSelector: FC = ({ onChange, active, allText }) => ( diff --git a/src/utils/dates/DateRangeRow.tsx b/src/utils/dates/DateRangeRow.tsx index f5e33ff4..c469d561 100644 --- a/src/utils/dates/DateRangeRow.tsx +++ b/src/utils/dates/DateRangeRow.tsx @@ -1,6 +1,6 @@ import { endOfDay } from 'date-fns'; import { DateInput } from './DateInput'; -import { DateRange } from '../helpers/dateIntervals'; +import type { DateRange } from '../helpers/dateIntervals'; interface DateRangeRowProps extends DateRange { onStartDateChange: (date: Date | null) => void; diff --git a/src/utils/dates/DateRangeSelector.tsx b/src/utils/dates/DateRangeSelector.tsx index 3aaeaf9e..93195420 100644 --- a/src/utils/dates/DateRangeSelector.tsx +++ b/src/utils/dates/DateRangeSelector.tsx @@ -2,9 +2,10 @@ import { useState } from 'react'; import { DropdownItem } from 'reactstrap'; import { DropdownBtn } from '../DropdownBtn'; import { useEffectExceptFirstTime } from '../helpers/hooks'; -import { +import type { DateInterval, - DateRange, + DateRange } from '../helpers/dateIntervals'; +import { rangeOrIntervalToString, intervalToDateRange, rangeIsInterval, diff --git a/src/utils/dates/DateTimeInput.tsx b/src/utils/dates/DateTimeInput.tsx index ddc45acb..3b787909 100644 --- a/src/utils/dates/DateTimeInput.tsx +++ b/src/utils/dates/DateTimeInput.tsx @@ -1,5 +1,5 @@ -import { ReactDatePickerProps } from 'react-datepicker'; -import { FC } from 'react'; +import type { ReactDatePickerProps } from 'react-datepicker'; +import type { FC } from 'react'; import { DateInput } from './DateInput'; import { STANDARD_DATE_AND_TIME_FORMAT } from '../helpers/date'; diff --git a/src/utils/forms/FormText.tsx b/src/utils/forms/FormText.tsx index c3e1a685..f80b5094 100644 --- a/src/utils/forms/FormText.tsx +++ b/src/utils/forms/FormText.tsx @@ -1,4 +1,4 @@ -import { FC, PropsWithChildren } from 'react'; +import type { FC, PropsWithChildren } from 'react'; export const FormText: FC> = ({ children }) => ( {children} diff --git a/src/utils/forms/InputFormGroup.tsx b/src/utils/forms/InputFormGroup.tsx index 9dabb6b1..6fda7b60 100644 --- a/src/utils/forms/InputFormGroup.tsx +++ b/src/utils/forms/InputFormGroup.tsx @@ -1,5 +1,5 @@ -import { FC, PropsWithChildren } from 'react'; -import { InputType } from 'reactstrap/types/lib/Input'; +import type { FC, PropsWithChildren } from 'react'; +import type { InputType } from 'reactstrap/types/lib/Input'; import { LabeledFormGroup } from './LabeledFormGroup'; import { useDomId } from '../helpers/hooks'; diff --git a/src/utils/forms/LabeledFormGroup.tsx b/src/utils/forms/LabeledFormGroup.tsx index dfc68729..24ed4044 100644 --- a/src/utils/forms/LabeledFormGroup.tsx +++ b/src/utils/forms/LabeledFormGroup.tsx @@ -1,4 +1,4 @@ -import { FC, PropsWithChildren, ReactNode } from 'react'; +import type { FC, PropsWithChildren, ReactNode } from 'react'; type LabeledFormGroupProps = PropsWithChildren<{ label: ReactNode; diff --git a/src/utils/helpers/charts.ts b/src/utils/helpers/charts.ts index 7914eee8..87331d24 100644 --- a/src/utils/helpers/charts.ts +++ b/src/utils/helpers/charts.ts @@ -1,4 +1,4 @@ -import { ActiveElement, ChartEvent, ChartType, TooltipItem } from 'chart.js'; +import type { ActiveElement, ChartEvent, ChartType, TooltipItem } from 'chart.js'; import { prettify } from './numbers'; export const pointerOnHover = ({ native }: ChartEvent, [firstElement]: ActiveElement[]) => { diff --git a/src/utils/helpers/date.ts b/src/utils/helpers/date.ts index b766974c..ebb33605 100644 --- a/src/utils/helpers/date.ts +++ b/src/utils/helpers/date.ts @@ -1,5 +1,5 @@ import { format, formatISO, isBefore, isEqual, isWithinInterval, parse, parseISO as stdParseISO } from 'date-fns'; -import { OptionalString } from '../utils'; +import type { OptionalString } from '../utils'; export const STANDARD_DATE_FORMAT = 'yyyy-MM-dd'; diff --git a/src/utils/helpers/dateIntervals.ts b/src/utils/helpers/dateIntervals.ts index 248fcb5a..462feb87 100644 --- a/src/utils/helpers/dateIntervals.ts +++ b/src/utils/helpers/dateIntervals.ts @@ -1,6 +1,7 @@ import { subDays, startOfDay, endOfDay } from 'date-fns'; import { cond, filter, isEmpty, T } from 'ramda'; -import { dateOrNull, DateOrString, formatInternational, isBeforeOrEqual, now, parseISO } from './date'; +import type { DateOrString } from './date'; +import { dateOrNull, formatInternational, isBeforeOrEqual, now, parseISO } from './date'; import { equals } from '../utils'; export interface DateRange { diff --git a/src/utils/helpers/features.ts b/src/utils/helpers/features.ts index b85551cc..d4700802 100644 --- a/src/utils/helpers/features.ts +++ b/src/utils/helpers/features.ts @@ -1,5 +1,7 @@ -import { isReachableServer, SelectedServer } from '../../servers/data'; -import { SemVerPattern, versionMatch } from './version'; +import type { SelectedServer } from '../../servers/data'; +import { isReachableServer } from '../../servers/data'; +import type { SemVerPattern } from './version'; +import { versionMatch } from './version'; const serverMatchesMinVersion = (minVersion: SemVerPattern) => (selectedServer: SelectedServer): boolean => isReachableServer(selectedServer) && versionMatch(selectedServer.version, { minVersion }); diff --git a/src/utils/helpers/hooks.ts b/src/utils/helpers/hooks.ts index fc596ddb..020428a9 100644 --- a/src/utils/helpers/hooks.ts +++ b/src/utils/helpers/hooks.ts @@ -1,4 +1,5 @@ -import { DependencyList, EffectCallback, useEffect, useRef, useState } from 'react'; +import type { DependencyList, EffectCallback } from 'react'; +import { useEffect, useRef, useState } from 'react'; import { useSwipeable as useReactSwipeable } from 'react-swipeable'; import { useLocation, useNavigate } from 'react-router-dom'; import { v4 as uuid } from 'uuid'; diff --git a/src/utils/helpers/redux.ts b/src/utils/helpers/redux.ts index 69309bf9..e113c937 100644 --- a/src/utils/helpers/redux.ts +++ b/src/utils/helpers/redux.ts @@ -1,6 +1,7 @@ -import { createAsyncThunk as baseCreateAsyncThunk, AsyncThunkPayloadCreator } from '@reduxjs/toolkit'; +import type { AsyncThunkPayloadCreator } from '@reduxjs/toolkit'; +import { createAsyncThunk as baseCreateAsyncThunk } from '@reduxjs/toolkit'; import { identity } from 'ramda'; -import { ShlinkState } from '../../container/types'; +import type { ShlinkState } from '../../container/types'; export const createAsyncThunk = ( typePrefix: string, diff --git a/src/utils/helpers/version.ts b/src/utils/helpers/version.ts index 6116a6da..91ef66d5 100644 --- a/src/utils/helpers/version.ts +++ b/src/utils/helpers/version.ts @@ -1,6 +1,7 @@ import { compare } from 'compare-versions'; import { identity, memoizeWith } from 'ramda'; -import { Empty, hasValue } from '../utils'; +import type { Empty } from '../utils'; +import { hasValue } from '../utils'; type SemVerPatternFragment = `${bigint | '*'}`; diff --git a/src/utils/helpers/visits.ts b/src/utils/helpers/visits.ts index 3b081814..fb8f12c4 100644 --- a/src/utils/helpers/visits.ts +++ b/src/utils/helpers/visits.ts @@ -1,7 +1,8 @@ import bowser from 'bowser'; import { zipObj } from 'ramda'; -import { Empty, hasValue } from '../utils'; -import { Stats, UserAgent } from '../../visits/types'; +import type { Empty } from '../utils'; +import { hasValue } from '../utils'; +import type { Stats, UserAgent } from '../../visits/types'; const DEFAULT = 'Others'; const BROWSERS_WHITELIST = [ diff --git a/src/utils/services/ColorGenerator.ts b/src/utils/services/ColorGenerator.ts index b440ab52..789fe122 100644 --- a/src/utils/services/ColorGenerator.ts +++ b/src/utils/services/ColorGenerator.ts @@ -1,6 +1,6 @@ import { isNil } from 'ramda'; import { rangeOf } from '../utils'; -import { LocalStorage } from './LocalStorage'; +import type { LocalStorage } from './LocalStorage'; const HEX_COLOR_LENGTH = 6; const HEX_DIGITS = '0123456789ABCDEF'; diff --git a/src/utils/services/provideServices.ts b/src/utils/services/provideServices.ts index 66ca8d0e..eeb3d326 100644 --- a/src/utils/services/provideServices.ts +++ b/src/utils/services/provideServices.ts @@ -1,4 +1,4 @@ -import Bottle from 'bottlejs'; +import type Bottle from 'bottlejs'; import { useTimeoutToggle } from '../helpers/hooks'; import { LocalStorage } from './LocalStorage'; import { ColorGenerator } from './ColorGenerator'; diff --git a/src/utils/table/TableOrderIcon.tsx b/src/utils/table/TableOrderIcon.tsx index 20622340..fbf7bd7a 100644 --- a/src/utils/table/TableOrderIcon.tsx +++ b/src/utils/table/TableOrderIcon.tsx @@ -1,6 +1,6 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { faCaretDown as caretDownIcon, faCaretUp as caretUpIcon } from '@fortawesome/free-solid-svg-icons'; -import { Order } from '../helpers/ordering'; +import type { Order } from '../helpers/ordering'; interface TableOrderIconProps { currentOrder: Order; diff --git a/src/utils/utils.ts b/src/utils/utils.ts index 4ddef89d..243b4b99 100644 --- a/src/utils/utils.ts +++ b/src/utils/utils.ts @@ -1,5 +1,5 @@ import { isEmpty, isNil, pipe, range } from 'ramda'; -import { SyntheticEvent } from 'react'; +import type { SyntheticEvent } from 'react'; export const rangeOf = (size: number, mappingFn: (value: number) => T, startAt = 1): T[] => range(startAt, size + 1).map(mappingFn); diff --git a/src/visits/DomainVisits.tsx b/src/visits/DomainVisits.tsx index e2f5d3ba..8564f390 100644 --- a/src/visits/DomainVisits.tsx +++ b/src/visits/DomainVisits.tsx @@ -1,13 +1,13 @@ import { useParams } from 'react-router-dom'; -import { CommonVisitsProps } from './types/CommonVisitsProps'; -import { ShlinkVisitsParams } from '../api/types'; -import { DomainVisits as DomainVisitsState, LoadDomainVisits } from './reducers/domainVisits'; -import { ReportExporter } from '../common/services/ReportExporter'; +import type { CommonVisitsProps } from './types/CommonVisitsProps'; +import type { ShlinkVisitsParams } from '../api/types'; +import type { DomainVisits as DomainVisitsState, LoadDomainVisits } from './reducers/domainVisits'; +import type { ReportExporter } from '../common/services/ReportExporter'; import { boundToMercureHub } from '../mercure/helpers/boundToMercureHub'; import { Topics } from '../mercure/helpers/Topics'; import { useGoBack } from '../utils/helpers/hooks'; import { toApiParams } from './types/helpers'; -import { NormalizedVisit } from './types'; +import type { NormalizedVisit } from './types'; import { VisitsStats } from './VisitsStats'; import { VisitsHeader } from './VisitsHeader'; diff --git a/src/visits/NonOrphanVisits.tsx b/src/visits/NonOrphanVisits.tsx index 3515afb8..b7d64a81 100644 --- a/src/visits/NonOrphanVisits.tsx +++ b/src/visits/NonOrphanVisits.tsx @@ -1,13 +1,13 @@ import { boundToMercureHub } from '../mercure/helpers/boundToMercureHub'; import { Topics } from '../mercure/helpers/Topics'; import { useGoBack } from '../utils/helpers/hooks'; -import { ReportExporter } from '../common/services/ReportExporter'; +import type { ReportExporter } from '../common/services/ReportExporter'; import { VisitsStats } from './VisitsStats'; -import { NormalizedVisit, VisitsParams } from './types'; -import { CommonVisitsProps } from './types/CommonVisitsProps'; +import type { NormalizedVisit, VisitsParams } from './types'; +import type { CommonVisitsProps } from './types/CommonVisitsProps'; import { toApiParams } from './types/helpers'; import { VisitsHeader } from './VisitsHeader'; -import { LoadVisits, VisitsInfo } from './reducers/types'; +import type { LoadVisits, VisitsInfo } from './reducers/types'; export interface NonOrphanVisitsProps extends CommonVisitsProps { getNonOrphanVisits: (params: LoadVisits) => void; diff --git a/src/visits/OrphanVisits.tsx b/src/visits/OrphanVisits.tsx index 3a7d711b..ba14d534 100644 --- a/src/visits/OrphanVisits.tsx +++ b/src/visits/OrphanVisits.tsx @@ -1,14 +1,14 @@ import { boundToMercureHub } from '../mercure/helpers/boundToMercureHub'; import { Topics } from '../mercure/helpers/Topics'; import { useGoBack } from '../utils/helpers/hooks'; -import { ReportExporter } from '../common/services/ReportExporter'; +import type { ReportExporter } from '../common/services/ReportExporter'; import { VisitsStats } from './VisitsStats'; -import { NormalizedVisit, VisitsParams } from './types'; -import { CommonVisitsProps } from './types/CommonVisitsProps'; +import type { NormalizedVisit, VisitsParams } from './types'; +import type { CommonVisitsProps } from './types/CommonVisitsProps'; import { toApiParams } from './types/helpers'; import { VisitsHeader } from './VisitsHeader'; -import { VisitsInfo } from './reducers/types'; -import { LoadOrphanVisits } from './reducers/orphanVisits'; +import type { VisitsInfo } from './reducers/types'; +import type { LoadOrphanVisits } from './reducers/orphanVisits'; export interface OrphanVisitsProps extends CommonVisitsProps { getOrphanVisits: (params: LoadOrphanVisits) => void; diff --git a/src/visits/ShortUrlVisits.tsx b/src/visits/ShortUrlVisits.tsx index 47b23d27..03154895 100644 --- a/src/visits/ShortUrlVisits.tsx +++ b/src/visits/ShortUrlVisits.tsx @@ -3,17 +3,17 @@ import { useLocation, useParams } from 'react-router-dom'; import { boundToMercureHub } from '../mercure/helpers/boundToMercureHub'; import { parseQuery } from '../utils/helpers/query'; import { Topics } from '../mercure/helpers/Topics'; -import { ShortUrlDetail } from '../short-urls/reducers/shortUrlDetail'; +import type { ShortUrlDetail } from '../short-urls/reducers/shortUrlDetail'; import { useGoBack } from '../utils/helpers/hooks'; -import { ReportExporter } from '../common/services/ReportExporter'; -import { LoadShortUrlVisits, ShortUrlVisits as ShortUrlVisitsState } from './reducers/shortUrlVisits'; +import type { ReportExporter } from '../common/services/ReportExporter'; +import type { LoadShortUrlVisits, ShortUrlVisits as ShortUrlVisitsState } from './reducers/shortUrlVisits'; import { ShortUrlVisitsHeader } from './ShortUrlVisitsHeader'; import { VisitsStats } from './VisitsStats'; -import { NormalizedVisit, VisitsParams } from './types'; -import { CommonVisitsProps } from './types/CommonVisitsProps'; +import type { NormalizedVisit, VisitsParams } from './types'; +import type { CommonVisitsProps } from './types/CommonVisitsProps'; import { toApiParams } from './types/helpers'; import { urlDecodeShortCode } from '../short-urls/helpers'; -import { ShortUrlIdentifier } from '../short-urls/data'; +import type { ShortUrlIdentifier } from '../short-urls/data'; export interface ShortUrlVisitsProps extends CommonVisitsProps { getShortUrlVisits: (params: LoadShortUrlVisits) => void; diff --git a/src/visits/ShortUrlVisitsHeader.tsx b/src/visits/ShortUrlVisitsHeader.tsx index bac9587f..52088dfd 100644 --- a/src/visits/ShortUrlVisitsHeader.tsx +++ b/src/visits/ShortUrlVisitsHeader.tsx @@ -1,8 +1,8 @@ import { UncontrolledTooltip } from 'reactstrap'; import { ExternalLink } from 'react-external-link'; -import { ShortUrlDetail } from '../short-urls/reducers/shortUrlDetail'; +import type { ShortUrlDetail } from '../short-urls/reducers/shortUrlDetail'; import { Time } from '../utils/dates/Time'; -import { ShortUrlVisits } from './reducers/shortUrlVisits'; +import type { ShortUrlVisits } from './reducers/shortUrlVisits'; import { VisitsHeader } from './VisitsHeader'; import './ShortUrlVisitsHeader.scss'; diff --git a/src/visits/TagVisits.tsx b/src/visits/TagVisits.tsx index 3d2510c1..85738cf3 100644 --- a/src/visits/TagVisits.tsx +++ b/src/visits/TagVisits.tsx @@ -1,15 +1,15 @@ import { useParams } from 'react-router-dom'; import { boundToMercureHub } from '../mercure/helpers/boundToMercureHub'; -import { ColorGenerator } from '../utils/services/ColorGenerator'; -import { ShlinkVisitsParams } from '../api/types'; +import type { ColorGenerator } from '../utils/services/ColorGenerator'; +import type { ShlinkVisitsParams } from '../api/types'; import { Topics } from '../mercure/helpers/Topics'; import { useGoBack } from '../utils/helpers/hooks'; -import { ReportExporter } from '../common/services/ReportExporter'; -import { LoadTagVisits, TagVisits as TagVisitsState } from './reducers/tagVisits'; +import type { ReportExporter } from '../common/services/ReportExporter'; +import type { LoadTagVisits, TagVisits as TagVisitsState } from './reducers/tagVisits'; import { TagVisitsHeader } from './TagVisitsHeader'; import { VisitsStats } from './VisitsStats'; -import { NormalizedVisit } from './types'; -import { CommonVisitsProps } from './types/CommonVisitsProps'; +import type { NormalizedVisit } from './types'; +import type { CommonVisitsProps } from './types/CommonVisitsProps'; import { toApiParams } from './types/helpers'; export interface TagVisitsProps extends CommonVisitsProps { diff --git a/src/visits/TagVisitsHeader.tsx b/src/visits/TagVisitsHeader.tsx index 0de9df7c..6a3970cf 100644 --- a/src/visits/TagVisitsHeader.tsx +++ b/src/visits/TagVisitsHeader.tsx @@ -1,7 +1,7 @@ import { Tag } from '../tags/helpers/Tag'; -import { ColorGenerator } from '../utils/services/ColorGenerator'; +import type { ColorGenerator } from '../utils/services/ColorGenerator'; import { VisitsHeader } from './VisitsHeader'; -import { TagVisits } from './reducers/tagVisits'; +import type { TagVisits } from './reducers/tagVisits'; import './ShortUrlVisitsHeader.scss'; interface TagVisitsHeaderProps { diff --git a/src/visits/VisitsHeader.tsx b/src/visits/VisitsHeader.tsx index 7dca6459..e42a8b82 100644 --- a/src/visits/VisitsHeader.tsx +++ b/src/visits/VisitsHeader.tsx @@ -1,10 +1,10 @@ import { Button, Card } from 'reactstrap'; -import { FC, PropsWithChildren, ReactNode } from 'react'; +import type { FC, PropsWithChildren, ReactNode } from 'react'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { faArrowLeft } from '@fortawesome/free-solid-svg-icons'; import { ShortUrlVisitsCount } from '../short-urls/helpers/ShortUrlVisitsCount'; -import { ShortUrl } from '../short-urls/data'; -import { Visit } from './types'; +import type { ShortUrl } from '../short-urls/data'; +import type { Visit } from './types'; type VisitsHeaderProps = PropsWithChildren<{ visits: Visit[]; diff --git a/src/visits/VisitsStats.tsx b/src/visits/VisitsStats.tsx index d2c2a767..72f618a2 100644 --- a/src/visits/VisitsStats.tsx +++ b/src/visits/VisitsStats.tsx @@ -1,31 +1,34 @@ import { isEmpty, pipe, propEq, values } from 'ramda'; -import { useState, useEffect, useMemo, FC, useRef, PropsWithChildren } from 'react'; +import type { FC, PropsWithChildren } from 'react'; +import { useState, useEffect, useMemo, useRef } from 'react'; import { Button, Progress, Row } from 'reactstrap'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { faCalendarAlt, faMapMarkedAlt, faList, faChartPie } from '@fortawesome/free-solid-svg-icons'; -import { IconDefinition } from '@fortawesome/fontawesome-common-types'; +import type { IconDefinition } from '@fortawesome/fontawesome-common-types'; import { Route, Routes, Navigate, useLocation } from 'react-router-dom'; import classNames from 'classnames'; import { DateRangeSelector } from '../utils/dates/DateRangeSelector'; import { Message } from '../utils/Message'; import { Result } from '../utils/Result'; import { ShlinkApiError } from '../api/ShlinkApiError'; -import { Settings } from '../settings/reducers/settings'; +import type { Settings } from '../settings/reducers/settings'; import { prettify } from '../utils/helpers/numbers'; import { NavPillItem, NavPills } from '../utils/NavPills'; import { ExportBtn } from '../utils/ExportBtn'; import { LineChartCard } from './charts/LineChartCard'; import { VisitsTable } from './VisitsTable'; -import { NormalizedOrphanVisit, NormalizedVisit, VisitsParams } from './types'; +import type { NormalizedOrphanVisit, NormalizedVisit, VisitsParams } from './types'; import { OpenMapModalBtn } from './helpers/OpenMapModalBtn'; import { normalizeVisits, processStatsFromVisits } from './services/VisitsParser'; import { VisitsFilterDropdown } from './helpers/VisitsFilterDropdown'; -import { HighlightableProps, highlightedVisitsToStats } from './types/helpers'; +import type { HighlightableProps } from './types/helpers'; +import { highlightedVisitsToStats } from './types/helpers'; import { DoughnutChartCard } from './charts/DoughnutChartCard'; import { SortableBarChartCard } from './charts/SortableBarChartCard'; -import { VisitsInfo } from './reducers/types'; +import type { VisitsInfo } from './reducers/types'; import { useVisitsQuery } from './helpers/hooks'; -import { DateInterval, DateRange, toDateRange } from '../utils/helpers/dateIntervals'; +import type { DateInterval, DateRange } from '../utils/helpers/dateIntervals'; +import { toDateRange } from '../utils/helpers/dateIntervals'; export type VisitsStatsProps = PropsWithChildren<{ getVisits: (params: VisitsParams, doIntervalFallback?: boolean) => void; diff --git a/src/visits/VisitsTable.tsx b/src/visits/VisitsTable.tsx index 311ce160..0990e426 100644 --- a/src/visits/VisitsTable.tsx +++ b/src/visits/VisitsTable.tsx @@ -6,12 +6,13 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { UncontrolledTooltip } from 'reactstrap'; import { SimplePaginator } from '../common/SimplePaginator'; import { SearchField } from '../utils/SearchField'; -import { determineOrderDir, Order, sortList } from '../utils/helpers/ordering'; +import type { Order } from '../utils/helpers/ordering'; +import { determineOrderDir, sortList } from '../utils/helpers/ordering'; import { prettify } from '../utils/helpers/numbers'; import { Time } from '../utils/dates/Time'; import { TableOrderIcon } from '../utils/table/TableOrderIcon'; -import { MediaMatcher } from '../utils/types'; -import { NormalizedOrphanVisit, NormalizedVisit } from './types'; +import type { MediaMatcher } from '../utils/types'; +import type { NormalizedOrphanVisit, NormalizedVisit } from './types'; import './VisitsTable.scss'; export interface VisitsTableProps { diff --git a/src/visits/charts/ChartCard.tsx b/src/visits/charts/ChartCard.tsx index bb1e8253..8f74f1d1 100644 --- a/src/visits/charts/ChartCard.tsx +++ b/src/visits/charts/ChartCard.tsx @@ -1,5 +1,5 @@ import { Card, CardHeader, CardBody, CardFooter } from 'reactstrap'; -import { FC, PropsWithChildren, ReactNode } from 'react'; +import type { FC, PropsWithChildren, ReactNode } from 'react'; import './ChartCard.scss'; type ChartCardProps = PropsWithChildren<{ diff --git a/src/visits/charts/DoughnutChart.tsx b/src/visits/charts/DoughnutChart.tsx index bc403488..f41337aa 100644 --- a/src/visits/charts/DoughnutChart.tsx +++ b/src/visits/charts/DoughnutChart.tsx @@ -1,10 +1,11 @@ -import { FC, useState, memo } from 'react'; -import { Chart, ChartData, ChartDataset, ChartOptions } from 'chart.js'; +import type { FC } from 'react'; +import { useState, memo } from 'react'; +import type { Chart, ChartData, ChartDataset, ChartOptions } from 'chart.js'; import { keys, values } from 'ramda'; import { Doughnut } from 'react-chartjs-2'; import { renderPieChartLabel } from '../../utils/helpers/charts'; import { isDarkThemeEnabled, PRIMARY_DARK_COLOR, PRIMARY_LIGHT_COLOR } from '../../utils/theme'; -import { Stats } from '../types'; +import type { Stats } from '../types'; import { DoughnutChartLegend } from './DoughnutChartLegend'; interface DoughnutChartProps { diff --git a/src/visits/charts/DoughnutChartCard.tsx b/src/visits/charts/DoughnutChartCard.tsx index 3febaacc..fc3c2425 100644 --- a/src/visits/charts/DoughnutChartCard.tsx +++ b/src/visits/charts/DoughnutChartCard.tsx @@ -1,5 +1,5 @@ -import { FC } from 'react'; -import { Stats } from '../types'; +import type { FC } from 'react'; +import type { Stats } from '../types'; import { DoughnutChart } from './DoughnutChart'; import { ChartCard } from './ChartCard'; diff --git a/src/visits/charts/DoughnutChartLegend.tsx b/src/visits/charts/DoughnutChartLegend.tsx index cd843031..d075492c 100644 --- a/src/visits/charts/DoughnutChartLegend.tsx +++ b/src/visits/charts/DoughnutChartLegend.tsx @@ -1,5 +1,5 @@ -import { FC } from 'react'; -import { Chart } from 'chart.js'; +import type { FC } from 'react'; +import type { Chart } from 'chart.js'; import './DoughnutChartLegend.scss'; interface DoughnutChartLegendProps { diff --git a/src/visits/charts/HorizontalBarChart.tsx b/src/visits/charts/HorizontalBarChart.tsx index 2c9bcb22..5de8885e 100644 --- a/src/visits/charts/HorizontalBarChart.tsx +++ b/src/visits/charts/HorizontalBarChart.tsx @@ -1,11 +1,12 @@ -import { FC, MutableRefObject, useRef } from 'react'; -import { ChartData, ChartDataset, ChartOptions, InteractionItem } from 'chart.js'; +import type { FC, MutableRefObject } from 'react'; +import { useRef } from 'react'; +import type { ChartData, ChartDataset, ChartOptions, InteractionItem } from 'chart.js'; import { keys, values } from 'ramda'; import { Bar, getElementAtEvent } from 'react-chartjs-2'; import { fillTheGaps } from '../../utils/helpers/visits'; import { pointerOnHover, renderChartLabel } from '../../utils/helpers/charts'; import { prettify } from '../../utils/helpers/numbers'; -import { Stats } from '../types'; +import type { Stats } from '../types'; import { HIGHLIGHTED_COLOR, HIGHLIGHTED_COLOR_ALPHA, MAIN_COLOR, MAIN_COLOR_ALPHA } from '../../utils/theme'; export interface HorizontalBarChartProps { diff --git a/src/visits/charts/LineChartCard.tsx b/src/visits/charts/LineChartCard.tsx index c83fd5b8..b44de862 100644 --- a/src/visits/charts/LineChartCard.tsx +++ b/src/visits/charts/LineChartCard.tsx @@ -1,4 +1,5 @@ -import { useState, useMemo, MutableRefObject, useRef } from 'react'; +import type { MutableRefObject } from 'react'; +import { useState, useMemo, useRef } from 'react'; import { Card, CardHeader, @@ -21,8 +22,8 @@ import { startOfISOWeek, endOfISOWeek, } from 'date-fns'; -import { ChartData, ChartDataset, ChartOptions, InteractionItem } from 'chart.js'; -import { NormalizedVisit, Stats } from '../types'; +import type { ChartData, ChartDataset, ChartOptions, InteractionItem } from 'chart.js'; +import type { NormalizedVisit, Stats } from '../types'; import { fillTheGaps } from '../../utils/helpers/visits'; import { useToggle } from '../../utils/helpers/hooks'; import { rangeOf } from '../../utils/utils'; diff --git a/src/visits/charts/SortableBarChartCard.tsx b/src/visits/charts/SortableBarChartCard.tsx index 04ac4f33..a1ee4c37 100644 --- a/src/visits/charts/SortableBarChartCard.tsx +++ b/src/visits/charts/SortableBarChartCard.tsx @@ -1,13 +1,15 @@ -import { FC, ReactNode, useState } from 'react'; +import type { FC, ReactNode } from 'react'; +import { useState } from 'react'; import { fromPairs, pipe, reverse, sortBy, splitEvery, toLower, toPairs, type, zipObj } from 'ramda'; import { rangeOf } from '../../utils/utils'; -import { Order } from '../../utils/helpers/ordering'; +import type { Order } from '../../utils/helpers/ordering'; import { SimplePaginator } from '../../common/SimplePaginator'; import { roundTen } from '../../utils/helpers/numbers'; import { OrderingDropdown } from '../../utils/OrderingDropdown'; import { PaginationDropdown } from '../../utils/PaginationDropdown'; -import { Stats, StatsRow } from '../types'; -import { HorizontalBarChart, HorizontalBarChartProps } from './HorizontalBarChart'; +import type { Stats, StatsRow } from '../types'; +import type { HorizontalBarChartProps } from './HorizontalBarChart'; +import { HorizontalBarChart } from './HorizontalBarChart'; import { ChartCard } from './ChartCard'; interface SortableBarChartCardProps extends Omit { diff --git a/src/visits/helpers/MapModal.tsx b/src/visits/helpers/MapModal.tsx index c2118031..cfb69ffc 100644 --- a/src/visits/helpers/MapModal.tsx +++ b/src/visits/helpers/MapModal.tsx @@ -1,8 +1,9 @@ -import { FC } from 'react'; +import type { FC } from 'react'; import { Modal, ModalBody } from 'reactstrap'; -import { MapContainer, TileLayer, Marker, Popup, MapContainerProps } from 'react-leaflet'; +import type { MapContainerProps } from 'react-leaflet'; +import { MapContainer, TileLayer, Marker, Popup } from 'react-leaflet'; import { prop } from 'ramda'; -import { CityStats } from '../types'; +import type { CityStats } from '../types'; import './MapModal.scss'; interface MapModalProps { diff --git a/src/visits/helpers/OpenMapModalBtn.tsx b/src/visits/helpers/OpenMapModalBtn.tsx index 9d3032e7..589ff55e 100644 --- a/src/visits/helpers/OpenMapModalBtn.tsx +++ b/src/visits/helpers/OpenMapModalBtn.tsx @@ -3,7 +3,7 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { faMapMarkedAlt as mapIcon } from '@fortawesome/free-solid-svg-icons'; import { Button, Dropdown, DropdownItem, DropdownMenu, UncontrolledTooltip } from 'reactstrap'; import { useDomId, useToggle } from '../../utils/helpers/hooks'; -import { CityStats } from '../types'; +import type { CityStats } from '../types'; import { MapModal } from './MapModal'; import './OpenMapModalBtn.scss'; diff --git a/src/visits/helpers/VisitsFilterDropdown.tsx b/src/visits/helpers/VisitsFilterDropdown.tsx index ebc5bc31..a1aca0ac 100644 --- a/src/visits/helpers/VisitsFilterDropdown.tsx +++ b/src/visits/helpers/VisitsFilterDropdown.tsx @@ -1,5 +1,6 @@ -import { DropdownItem, DropdownItemProps } from 'reactstrap'; -import { OrphanVisitType, VisitsFilter } from '../types'; +import type { DropdownItemProps } from 'reactstrap'; +import { DropdownItem } from 'reactstrap'; +import type { OrphanVisitType, VisitsFilter } from '../types'; import { DropdownBtn } from '../../utils/DropdownBtn'; import { hasValue } from '../../utils/utils'; diff --git a/src/visits/helpers/hooks.ts b/src/visits/helpers/hooks.ts index 1c57d8d7..e8b6d072 100644 --- a/src/visits/helpers/hooks.ts +++ b/src/visits/helpers/hooks.ts @@ -1,12 +1,14 @@ -import { DeepPartial } from '@reduxjs/toolkit'; +import type { DeepPartial } from '@reduxjs/toolkit'; import { useLocation, useNavigate } from 'react-router-dom'; import { useMemo } from 'react'; import { isEmpty, isNil, mergeDeepRight, pipe } from 'ramda'; -import { DateRange, datesToDateRange } from '../../utils/helpers/dateIntervals'; -import { OrphanVisitType, VisitsFilter } from '../types'; +import type { DateRange } from '../../utils/helpers/dateIntervals'; +import { datesToDateRange } from '../../utils/helpers/dateIntervals'; +import type { OrphanVisitType, VisitsFilter } from '../types'; import { parseQuery, stringifyQuery } from '../../utils/helpers/query'; import { formatIsoDate } from '../../utils/helpers/date'; -import { BooleanString, parseBooleanToString } from '../../utils/utils'; +import type { BooleanString } from '../../utils/utils'; +import { parseBooleanToString } from '../../utils/utils'; interface VisitsQuery { startDate?: string; diff --git a/src/visits/reducers/common.ts b/src/visits/reducers/common.ts index b3abfddd..108a2e56 100644 --- a/src/visits/reducers/common.ts +++ b/src/visits/reducers/common.ts @@ -1,11 +1,12 @@ import { flatten, prop, range, splitEvery } from 'ramda'; import { createAction, createSlice } from '@reduxjs/toolkit'; -import { ShlinkPaginator, ShlinkVisits, ShlinkVisitsParams } from '../../api/types'; -import { CreateVisit, Visit } from '../types'; -import { DateInterval, dateToMatchingInterval } from '../../utils/helpers/dateIntervals'; -import { LoadVisits, VisitsInfo, VisitsLoaded } from './types'; +import type { ShlinkPaginator, ShlinkVisits, ShlinkVisitsParams } from '../../api/types'; +import type { CreateVisit, Visit } from '../types'; +import type { DateInterval } from '../../utils/helpers/dateIntervals'; +import { dateToMatchingInterval } from '../../utils/helpers/dateIntervals'; +import type { LoadVisits, VisitsInfo, VisitsLoaded } from './types'; import { createAsyncThunk } from '../../utils/helpers/redux'; -import { ShlinkState } from '../../container/types'; +import type { ShlinkState } from '../../container/types'; import { parseApiError } from '../../api/utils'; import { createNewVisits } from './visitCreation'; diff --git a/src/visits/reducers/domainVisits.ts b/src/visits/reducers/domainVisits.ts index a44d1cfc..24018445 100644 --- a/src/visits/reducers/domainVisits.ts +++ b/src/visits/reducers/domainVisits.ts @@ -1,8 +1,8 @@ -import { ShlinkApiClientBuilder } from '../../api/services/ShlinkApiClientBuilder'; +import type { ShlinkApiClientBuilder } from '../../api/services/ShlinkApiClientBuilder'; import { isBetween } from '../../utils/helpers/date'; import { createVisitsAsyncThunk, createVisitsReducer, lastVisitLoaderForLoader } from './common'; import { domainMatches } from '../../short-urls/helpers'; -import { LoadVisits, VisitsInfo } from './types'; +import type { LoadVisits, VisitsInfo } from './types'; const REDUCER_PREFIX = 'shlink/domainVisits'; diff --git a/src/visits/reducers/nonOrphanVisits.ts b/src/visits/reducers/nonOrphanVisits.ts index 83db3f43..6156cb74 100644 --- a/src/visits/reducers/nonOrphanVisits.ts +++ b/src/visits/reducers/nonOrphanVisits.ts @@ -1,7 +1,7 @@ -import { ShlinkApiClientBuilder } from '../../api/services/ShlinkApiClientBuilder'; +import type { ShlinkApiClientBuilder } from '../../api/services/ShlinkApiClientBuilder'; import { isBetween } from '../../utils/helpers/date'; import { createVisitsAsyncThunk, createVisitsReducer, lastVisitLoaderForLoader } from './common'; -import { VisitsInfo } from './types'; +import type { VisitsInfo } from './types'; const REDUCER_PREFIX = 'shlink/orphanVisits'; diff --git a/src/visits/reducers/orphanVisits.ts b/src/visits/reducers/orphanVisits.ts index 269aa764..48292265 100644 --- a/src/visits/reducers/orphanVisits.ts +++ b/src/visits/reducers/orphanVisits.ts @@ -1,9 +1,9 @@ -import { OrphanVisit, OrphanVisitType } from '../types'; -import { ShlinkApiClientBuilder } from '../../api/services/ShlinkApiClientBuilder'; +import type { OrphanVisit, OrphanVisitType } from '../types'; +import type { ShlinkApiClientBuilder } from '../../api/services/ShlinkApiClientBuilder'; import { isOrphanVisit } from '../types/helpers'; import { isBetween } from '../../utils/helpers/date'; import { createVisitsAsyncThunk, createVisitsReducer, lastVisitLoaderForLoader } from './common'; -import { LoadVisits, VisitsInfo } from './types'; +import type { LoadVisits, VisitsInfo } from './types'; const REDUCER_PREFIX = 'shlink/orphanVisits'; diff --git a/src/visits/reducers/shortUrlVisits.ts b/src/visits/reducers/shortUrlVisits.ts index 1c434787..2e37b176 100644 --- a/src/visits/reducers/shortUrlVisits.ts +++ b/src/visits/reducers/shortUrlVisits.ts @@ -1,9 +1,9 @@ import { shortUrlMatches } from '../../short-urls/helpers'; -import { ShortUrlIdentifier } from '../../short-urls/data'; -import { ShlinkApiClientBuilder } from '../../api/services/ShlinkApiClientBuilder'; +import type { ShortUrlIdentifier } from '../../short-urls/data'; +import type { ShlinkApiClientBuilder } from '../../api/services/ShlinkApiClientBuilder'; import { isBetween } from '../../utils/helpers/date'; import { createVisitsAsyncThunk, createVisitsReducer, lastVisitLoaderForLoader } from './common'; -import { LoadVisits, VisitsInfo } from './types'; +import type { LoadVisits, VisitsInfo } from './types'; const REDUCER_PREFIX = 'shlink/shortUrlVisits'; diff --git a/src/visits/reducers/tagVisits.ts b/src/visits/reducers/tagVisits.ts index 66b86ca0..ff2b2374 100644 --- a/src/visits/reducers/tagVisits.ts +++ b/src/visits/reducers/tagVisits.ts @@ -1,7 +1,7 @@ -import { ShlinkApiClientBuilder } from '../../api/services/ShlinkApiClientBuilder'; +import type { ShlinkApiClientBuilder } from '../../api/services/ShlinkApiClientBuilder'; import { isBetween } from '../../utils/helpers/date'; import { createVisitsAsyncThunk, createVisitsReducer, lastVisitLoaderForLoader } from './common'; -import { LoadVisits, VisitsInfo } from './types'; +import type { LoadVisits, VisitsInfo } from './types'; const REDUCER_PREFIX = 'shlink/tagVisits'; diff --git a/src/visits/reducers/types/index.ts b/src/visits/reducers/types/index.ts index f3e0e353..f61be0a9 100644 --- a/src/visits/reducers/types/index.ts +++ b/src/visits/reducers/types/index.ts @@ -1,7 +1,7 @@ -import { ShlinkVisitsParams } from '../../../api/types'; -import { DateInterval } from '../../../utils/helpers/dateIntervals'; -import { ProblemDetailsError } from '../../../api/types/errors'; -import { Visit } from '../../types'; +import type { ShlinkVisitsParams } from '../../../api/types'; +import type { DateInterval } from '../../../utils/helpers/dateIntervals'; +import type { ProblemDetailsError } from '../../../api/types/errors'; +import type { Visit } from '../../types'; export interface VisitsInfo { visits: Visit[]; diff --git a/src/visits/reducers/visitCreation.ts b/src/visits/reducers/visitCreation.ts index eb037bd7..3504251e 100644 --- a/src/visits/reducers/visitCreation.ts +++ b/src/visits/reducers/visitCreation.ts @@ -1,5 +1,6 @@ -import { createAction, PayloadAction } from '@reduxjs/toolkit'; -import { CreateVisit } from '../types'; +import type { PayloadAction } from '@reduxjs/toolkit'; +import { createAction } from '@reduxjs/toolkit'; +import type { CreateVisit } from '../types'; export type CreateVisitsAction = PayloadAction<{ createdVisits: CreateVisit[]; diff --git a/src/visits/reducers/visitsOverview.ts b/src/visits/reducers/visitsOverview.ts index 105bfd2b..b1f6417e 100644 --- a/src/visits/reducers/visitsOverview.ts +++ b/src/visits/reducers/visitsOverview.ts @@ -1,6 +1,7 @@ -import { createSlice, PayloadAction } from '@reduxjs/toolkit'; -import { ShlinkVisitsOverview } from '../../api/types'; -import { ShlinkApiClientBuilder } from '../../api/services/ShlinkApiClientBuilder'; +import type { PayloadAction } from '@reduxjs/toolkit'; +import { createSlice } from '@reduxjs/toolkit'; +import type { ShlinkVisitsOverview } from '../../api/types'; +import type { ShlinkApiClientBuilder } from '../../api/services/ShlinkApiClientBuilder'; import { createAsyncThunk } from '../../utils/helpers/redux'; import { groupNewVisitsByType } from '../types/helpers'; import { createNewVisits } from './visitCreation'; diff --git a/src/visits/services/VisitsParser.ts b/src/visits/services/VisitsParser.ts index d9826152..9d10e706 100644 --- a/src/visits/services/VisitsParser.ts +++ b/src/visits/services/VisitsParser.ts @@ -1,7 +1,7 @@ import { isNil, map } from 'ramda'; import { extractDomain, parseUserAgent } from '../../utils/helpers/visits'; import { hasValue } from '../../utils/utils'; -import { CityStats, NormalizedVisit, Stats, Visit, VisitsStats } from '../types'; +import type { CityStats, NormalizedVisit, Stats, Visit, VisitsStats } from '../types'; import { isNormalizedOrphanVisit, isOrphanVisit } from '../types/helpers'; /* eslint-disable no-param-reassign */ diff --git a/src/visits/services/provideServices.ts b/src/visits/services/provideServices.ts index bff16548..569ae852 100644 --- a/src/visits/services/provideServices.ts +++ b/src/visits/services/provideServices.ts @@ -1,4 +1,4 @@ -import Bottle from 'bottlejs'; +import type Bottle from 'bottlejs'; import { prop } from 'ramda'; import { MapModal } from '../helpers/MapModal'; import { createNewVisits } from '../reducers/visitCreation'; @@ -11,7 +11,7 @@ import { getTagVisits, tagVisitsReducerCreator } from '../reducers/tagVisits'; import { getDomainVisits, domainVisitsReducerCreator } from '../reducers/domainVisits'; import { getOrphanVisits, orphanVisitsReducerCreator } from '../reducers/orphanVisits'; import { getNonOrphanVisits, nonOrphanVisitsReducerCreator } from '../reducers/nonOrphanVisits'; -import { ConnectDecorator } from '../../container/types'; +import type { ConnectDecorator } from '../../container/types'; import { loadVisitsOverview, visitsOverviewReducerCreator } from '../reducers/visitsOverview'; import * as visitsParser from './VisitsParser'; import { DomainVisits } from '../DomainVisits'; diff --git a/src/visits/types/CommonVisitsProps.ts b/src/visits/types/CommonVisitsProps.ts index d376f027..55ff817c 100644 --- a/src/visits/types/CommonVisitsProps.ts +++ b/src/visits/types/CommonVisitsProps.ts @@ -1,4 +1,4 @@ -import { Settings } from '../../settings/reducers/settings'; +import type { Settings } from '../../settings/reducers/settings'; export interface CommonVisitsProps { settings: Settings; diff --git a/src/visits/types/helpers.ts b/src/visits/types/helpers.ts index 04509d03..226a2514 100644 --- a/src/visits/types/helpers.ts +++ b/src/visits/types/helpers.ts @@ -1,7 +1,7 @@ import { countBy, groupBy, pipe, prop } from 'ramda'; import { formatIsoDate } from '../../utils/helpers/date'; -import { ShlinkVisitsParams } from '../../api/types'; -import { CreateVisit, NormalizedOrphanVisit, NormalizedVisit, OrphanVisit, Stats, Visit, VisitsParams } from './index'; +import type { ShlinkVisitsParams } from '../../api/types'; +import type { CreateVisit, NormalizedOrphanVisit, NormalizedVisit, OrphanVisit, Stats, Visit, VisitsParams } from './index'; export const isOrphanVisit = (visit: Visit): visit is OrphanVisit => (visit as OrphanVisit).visitedUrl !== undefined; diff --git a/src/visits/types/index.ts b/src/visits/types/index.ts index 0ff67d6b..503f8170 100644 --- a/src/visits/types/index.ts +++ b/src/visits/types/index.ts @@ -1,5 +1,5 @@ -import { ShortUrl } from '../../short-urls/data'; -import { DateRange } from '../../utils/helpers/dateIntervals'; +import type { ShortUrl } from '../../short-urls/data'; +import type { DateRange } from '../../utils/helpers/dateIntervals'; export type OrphanVisitType = 'base_url' | 'invalid_short_url' | 'regular_404'; diff --git a/test/__helpers__/TestModalWrapper.tsx b/test/__helpers__/TestModalWrapper.tsx index e2364192..a673827b 100644 --- a/test/__helpers__/TestModalWrapper.tsx +++ b/test/__helpers__/TestModalWrapper.tsx @@ -1,4 +1,4 @@ -import { FC, ReactElement } from 'react'; +import type { FC, ReactElement } from 'react'; import { useToggle } from '../../src/utils/helpers/hooks'; interface RenderModalArgs { diff --git a/test/__helpers__/setUpTest.ts b/test/__helpers__/setUpTest.ts index 210a88ff..424d177a 100644 --- a/test/__helpers__/setUpTest.ts +++ b/test/__helpers__/setUpTest.ts @@ -1,4 +1,4 @@ -import { ReactElement } from 'react'; +import type { ReactElement } from 'react'; import { render } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; diff --git a/test/api/ShlinkApiError.test.tsx b/test/api/ShlinkApiError.test.tsx index a7aaebc1..daa42f69 100644 --- a/test/api/ShlinkApiError.test.tsx +++ b/test/api/ShlinkApiError.test.tsx @@ -1,7 +1,9 @@ import { render, screen } from '@testing-library/react'; import { Mock } from 'ts-mockery'; -import { ShlinkApiError, ShlinkApiErrorProps } from '../../src/api/ShlinkApiError'; -import { ErrorTypeV2, ErrorTypeV3, InvalidArgumentError, ProblemDetailsError } from '../../src/api/types/errors'; +import type { ShlinkApiErrorProps } from '../../src/api/ShlinkApiError'; +import { ShlinkApiError } from '../../src/api/ShlinkApiError'; +import type { InvalidArgumentError, ProblemDetailsError } from '../../src/api/types/errors'; +import { ErrorTypeV2, ErrorTypeV3 } from '../../src/api/types/errors'; describe('', () => { const setUp = (props: ShlinkApiErrorProps) => render(); diff --git a/test/api/services/ShlinkApiClient.test.ts b/test/api/services/ShlinkApiClient.test.ts index 802e0678..ac8bdd98 100644 --- a/test/api/services/ShlinkApiClient.test.ts +++ b/test/api/services/ShlinkApiClient.test.ts @@ -1,10 +1,10 @@ import { Mock } from 'ts-mockery'; import { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient'; -import { OptionalString } from '../../../src/utils/utils'; -import { ShlinkDomain, ShlinkVisits, ShlinkVisitsOverview } from '../../../src/api/types'; -import { ShortUrl, ShortUrlsOrder } from '../../../src/short-urls/data'; +import type { OptionalString } from '../../../src/utils/utils'; +import type { ShlinkDomain, ShlinkVisits, ShlinkVisitsOverview } from '../../../src/api/types'; +import type { ShortUrl, ShortUrlsOrder } from '../../../src/short-urls/data'; import { ErrorTypeV2, ErrorTypeV3 } from '../../../src/api/types/errors'; -import { HttpClient } from '../../../src/common/services/HttpClient'; +import type { HttpClient } from '../../../src/common/services/HttpClient'; describe('ShlinkApiClient', () => { const fetchJson = jest.fn().mockResolvedValue({}); diff --git a/test/api/services/ShlinkApiClientBuilder.test.ts b/test/api/services/ShlinkApiClientBuilder.test.ts index 18c29ebf..f6dc44be 100644 --- a/test/api/services/ShlinkApiClientBuilder.test.ts +++ b/test/api/services/ShlinkApiClientBuilder.test.ts @@ -1,8 +1,8 @@ import { Mock } from 'ts-mockery'; import { buildShlinkApiClient } from '../../../src/api/services/ShlinkApiClientBuilder'; -import { ReachableServer, SelectedServer } from '../../../src/servers/data'; -import { ShlinkState } from '../../../src/container/types'; -import { HttpClient } from '../../../src/common/services/HttpClient'; +import type { ReachableServer, SelectedServer } from '../../../src/servers/data'; +import type { ShlinkState } from '../../../src/container/types'; +import type { HttpClient } from '../../../src/common/services/HttpClient'; describe('ShlinkApiClientBuilder', () => { const server = (data: Partial) => Mock.of(data); diff --git a/test/app/App.test.tsx b/test/app/App.test.tsx index a286c61f..234fd86f 100644 --- a/test/app/App.test.tsx +++ b/test/app/App.test.tsx @@ -2,7 +2,7 @@ import { render, screen } from '@testing-library/react'; import { Router } from 'react-router-dom'; import { createMemoryHistory } from 'history'; import { Mock } from 'ts-mockery'; -import { Settings } from '../../src/settings/reducers/settings'; +import type { Settings } from '../../src/settings/reducers/settings'; import { App as createApp } from '../../src/app/App'; describe('', () => { diff --git a/test/common/AsideMenu.test.tsx b/test/common/AsideMenu.test.tsx index 6874053d..0efe448d 100644 --- a/test/common/AsideMenu.test.tsx +++ b/test/common/AsideMenu.test.tsx @@ -2,7 +2,7 @@ import { render, screen } from '@testing-library/react'; import { Mock } from 'ts-mockery'; import { MemoryRouter } from 'react-router-dom'; import { AsideMenu as createAsideMenu } from '../../src/common/AsideMenu'; -import { ReachableServer } from '../../src/servers/data'; +import type { ReachableServer } from '../../src/servers/data'; describe('', () => { const AsideMenu = createAsideMenu(() => <>DeleteServerButton); diff --git a/test/common/Home.test.tsx b/test/common/Home.test.tsx index 75c14047..6308eb9a 100644 --- a/test/common/Home.test.tsx +++ b/test/common/Home.test.tsx @@ -2,7 +2,7 @@ import { render, screen } from '@testing-library/react'; import { Mock } from 'ts-mockery'; import { MemoryRouter } from 'react-router-dom'; import { Home } from '../../src/common/Home'; -import { ServersMap, ServerWithId } from '../../src/servers/data'; +import type { ServersMap, ServerWithId } from '../../src/servers/data'; describe('', () => { const setUp = (servers: ServersMap = {}) => render( diff --git a/test/common/MenuLayout.test.tsx b/test/common/MenuLayout.test.tsx index e2ebc468..ca2b9948 100644 --- a/test/common/MenuLayout.test.tsx +++ b/test/common/MenuLayout.test.tsx @@ -3,8 +3,8 @@ import { Router, useParams } from 'react-router-dom'; import { createMemoryHistory } from 'history'; import { Mock } from 'ts-mockery'; import { MenuLayout as createMenuLayout } from '../../src/common/MenuLayout'; -import { NonReachableServer, NotFoundServer, ReachableServer, SelectedServer } from '../../src/servers/data'; -import { SemVer } from '../../src/utils/helpers/version'; +import type { NonReachableServer, NotFoundServer, ReachableServer, SelectedServer } from '../../src/servers/data'; +import type { SemVer } from '../../src/utils/helpers/version'; jest.mock('react-router-dom', () => ({ ...jest.requireActual('react-router-dom'), useParams: jest.fn() })); diff --git a/test/common/ShlinkVersions.test.tsx b/test/common/ShlinkVersions.test.tsx index 7c6127f1..cd35d9d7 100644 --- a/test/common/ShlinkVersions.test.tsx +++ b/test/common/ShlinkVersions.test.tsx @@ -1,7 +1,8 @@ import { render, screen } from '@testing-library/react'; import { Mock } from 'ts-mockery'; -import { ShlinkVersions, ShlinkVersionsProps } from '../../src/common/ShlinkVersions'; -import { NonReachableServer, NotFoundServer, ReachableServer } from '../../src/servers/data'; +import type { ShlinkVersionsProps } from '../../src/common/ShlinkVersions'; +import { ShlinkVersions } from '../../src/common/ShlinkVersions'; +import type { NonReachableServer, NotFoundServer, ReachableServer } from '../../src/servers/data'; describe('', () => { const setUp = (props: ShlinkVersionsProps) => render(); diff --git a/test/common/ShlinkVersionsContainer.test.tsx b/test/common/ShlinkVersionsContainer.test.tsx index 1920fdc2..db3e7c9e 100644 --- a/test/common/ShlinkVersionsContainer.test.tsx +++ b/test/common/ShlinkVersionsContainer.test.tsx @@ -1,8 +1,8 @@ import { render } from '@testing-library/react'; import { Mock } from 'ts-mockery'; import { ShlinkVersionsContainer } from '../../src/common/ShlinkVersionsContainer'; -import { SelectedServer } from '../../src/servers/data'; -import { Sidebar } from '../../src/common/reducers/sidebar'; +import type { SelectedServer } from '../../src/servers/data'; +import type { Sidebar } from '../../src/common/reducers/sidebar'; describe('', () => { const setUp = (sidebar: Sidebar) => render( diff --git a/test/common/img/ShlinkLogo.test.tsx b/test/common/img/ShlinkLogo.test.tsx index d1c6cc61..6fcc6459 100644 --- a/test/common/img/ShlinkLogo.test.tsx +++ b/test/common/img/ShlinkLogo.test.tsx @@ -1,5 +1,6 @@ import { render } from '@testing-library/react'; -import { ShlinkLogo, ShlinkLogoProps } from '../../../src/common/img/ShlinkLogo'; +import type { ShlinkLogoProps } from '../../../src/common/img/ShlinkLogo'; +import { ShlinkLogo } from '../../../src/common/img/ShlinkLogo'; import { MAIN_COLOR } from '../../../src/utils/theme'; describe('', () => { diff --git a/test/common/services/ImageDownloader.test.ts b/test/common/services/ImageDownloader.test.ts index e33c4ecf..a1047c27 100644 --- a/test/common/services/ImageDownloader.test.ts +++ b/test/common/services/ImageDownloader.test.ts @@ -1,6 +1,6 @@ import { Mock } from 'ts-mockery'; import { ImageDownloader } from '../../../src/common/services/ImageDownloader'; -import { HttpClient } from '../../../src/common/services/HttpClient'; +import type { HttpClient } from '../../../src/common/services/HttpClient'; import { windowMock } from '../../__mocks__/Window.mock'; describe('ImageDownloader', () => { diff --git a/test/common/services/ReportExporter.test.ts b/test/common/services/ReportExporter.test.ts index 02097005..45f7b2a6 100644 --- a/test/common/services/ReportExporter.test.ts +++ b/test/common/services/ReportExporter.test.ts @@ -1,7 +1,7 @@ import { ReportExporter } from '../../../src/common/services/ReportExporter'; -import { NormalizedVisit } from '../../../src/visits/types'; +import type { NormalizedVisit } from '../../../src/visits/types'; import { windowMock } from '../../__mocks__/Window.mock'; -import { ExportableShortUrl } from '../../../src/short-urls/data'; +import type { ExportableShortUrl } from '../../../src/short-urls/data'; describe('ReportExporter', () => { const jsonToCsv = jest.fn(); diff --git a/test/domains/DomainRow.test.tsx b/test/domains/DomainRow.test.tsx index 0c506a88..1c26a18b 100644 --- a/test/domains/DomainRow.test.tsx +++ b/test/domains/DomainRow.test.tsx @@ -1,9 +1,9 @@ import { render, screen } from '@testing-library/react'; import { Mock } from 'ts-mockery'; -import { ShlinkDomainRedirects } from '../../src/api/types'; +import type { ShlinkDomainRedirects } from '../../src/api/types'; import { DomainRow } from '../../src/domains/DomainRow'; -import { SelectedServer } from '../../src/servers/data'; -import { Domain } from '../../src/domains/data'; +import type { SelectedServer } from '../../src/servers/data'; +import type { Domain } from '../../src/domains/data'; describe('', () => { const redirectsCombinations = [ diff --git a/test/domains/DomainSelector.test.tsx b/test/domains/DomainSelector.test.tsx index e2effdf4..97fd4e4d 100644 --- a/test/domains/DomainSelector.test.tsx +++ b/test/domains/DomainSelector.test.tsx @@ -1,8 +1,8 @@ import { screen, waitFor } from '@testing-library/react'; import { Mock } from 'ts-mockery'; import { DomainSelector } from '../../src/domains/DomainSelector'; -import { DomainsList } from '../../src/domains/reducers/domainsList'; -import { ShlinkDomain } from '../../src/api/types'; +import type { DomainsList } from '../../src/domains/reducers/domainsList'; +import type { ShlinkDomain } from '../../src/api/types'; import { renderWithEvents } from '../__helpers__/setUpTest'; describe('', () => { diff --git a/test/domains/ManageDomains.test.tsx b/test/domains/ManageDomains.test.tsx index 4726ed4e..0003e088 100644 --- a/test/domains/ManageDomains.test.tsx +++ b/test/domains/ManageDomains.test.tsx @@ -1,11 +1,11 @@ import { screen, waitFor } from '@testing-library/react'; import { Mock } from 'ts-mockery'; -import { DomainsList } from '../../src/domains/reducers/domainsList'; +import type { DomainsList } from '../../src/domains/reducers/domainsList'; import { ManageDomains } from '../../src/domains/ManageDomains'; -import { ShlinkDomain } from '../../src/api/types'; -import { SelectedServer } from '../../src/servers/data'; +import type { ShlinkDomain } from '../../src/api/types'; +import type { SelectedServer } from '../../src/servers/data'; import { renderWithEvents } from '../__helpers__/setUpTest'; -import { ProblemDetailsError } from '../../src/api/types/errors'; +import type { ProblemDetailsError } from '../../src/api/types/errors'; describe('', () => { const listDomains = jest.fn(); diff --git a/test/domains/helpers/DomainDropdown.test.tsx b/test/domains/helpers/DomainDropdown.test.tsx index 1efd1a5e..efcf1a8d 100644 --- a/test/domains/helpers/DomainDropdown.test.tsx +++ b/test/domains/helpers/DomainDropdown.test.tsx @@ -2,9 +2,9 @@ import { screen, waitForElementToBeRemoved } from '@testing-library/react'; import { Mock } from 'ts-mockery'; import { MemoryRouter } from 'react-router-dom'; import { DomainDropdown } from '../../../src/domains/helpers/DomainDropdown'; -import { Domain } from '../../../src/domains/data'; -import { ReachableServer, SelectedServer } from '../../../src/servers/data'; -import { SemVer } from '../../../src/utils/helpers/version'; +import type { Domain } from '../../../src/domains/data'; +import type { ReachableServer, SelectedServer } from '../../../src/servers/data'; +import type { SemVer } from '../../../src/utils/helpers/version'; import { renderWithEvents } from '../../__helpers__/setUpTest'; describe('', () => { diff --git a/test/domains/helpers/DomainStatusIcon.test.tsx b/test/domains/helpers/DomainStatusIcon.test.tsx index a95ab027..ee5d3410 100644 --- a/test/domains/helpers/DomainStatusIcon.test.tsx +++ b/test/domains/helpers/DomainStatusIcon.test.tsx @@ -1,6 +1,6 @@ import { screen } from '@testing-library/react'; import { Mock } from 'ts-mockery'; -import { DomainStatus } from '../../../src/domains/data'; +import type { DomainStatus } from '../../../src/domains/data'; import { DomainStatusIcon } from '../../../src/domains/helpers/DomainStatusIcon'; import { renderWithEvents } from '../../__helpers__/setUpTest'; diff --git a/test/domains/helpers/EditDomainRedirectsModal.test.tsx b/test/domains/helpers/EditDomainRedirectsModal.test.tsx index a83ddcbb..fb9a98fc 100644 --- a/test/domains/helpers/EditDomainRedirectsModal.test.tsx +++ b/test/domains/helpers/EditDomainRedirectsModal.test.tsx @@ -1,6 +1,6 @@ import { fireEvent, screen, waitFor } from '@testing-library/react'; import { Mock } from 'ts-mockery'; -import { ShlinkDomain } from '../../../src/api/types'; +import type { ShlinkDomain } from '../../../src/api/types'; import { EditDomainRedirectsModal } from '../../../src/domains/helpers/EditDomainRedirectsModal'; import { renderWithEvents } from '../../__helpers__/setUpTest'; diff --git a/test/domains/reducers/domainRedirects.test.ts b/test/domains/reducers/domainRedirects.test.ts index 567e0c1f..b061e7e7 100644 --- a/test/domains/reducers/domainRedirects.test.ts +++ b/test/domains/reducers/domainRedirects.test.ts @@ -1,7 +1,8 @@ import { Mock } from 'ts-mockery'; -import { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient'; -import { EditDomainRedirects, editDomainRedirects } from '../../../src/domains/reducers/domainRedirects'; -import { ShlinkDomainRedirects } from '../../../src/api/types'; +import type { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient'; +import type { EditDomainRedirects } from '../../../src/domains/reducers/domainRedirects'; +import { editDomainRedirects } from '../../../src/domains/reducers/domainRedirects'; +import type { ShlinkDomainRedirects } from '../../../src/api/types'; describe('domainRedirectsReducer', () => { beforeEach(jest.clearAllMocks); diff --git a/test/domains/reducers/domainsList.test.ts b/test/domains/reducers/domainsList.test.ts index b96a37d0..7f2772c3 100644 --- a/test/domains/reducers/domainsList.test.ts +++ b/test/domains/reducers/domainsList.test.ts @@ -1,16 +1,17 @@ import { Mock } from 'ts-mockery'; +import type { + DomainsList } from '../../../src/domains/reducers/domainsList'; import { - DomainsList, replaceRedirectsOnDomain, replaceStatusOnDomain, domainsListReducerCreator, } from '../../../src/domains/reducers/domainsList'; import { editDomainRedirects } from '../../../src/domains/reducers/domainRedirects'; -import { ShlinkDomainRedirects } from '../../../src/api/types'; -import { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient'; -import { Domain } from '../../../src/domains/data'; -import { ShlinkState } from '../../../src/container/types'; -import { SelectedServer, ServerData } from '../../../src/servers/data'; +import type { ShlinkDomainRedirects } from '../../../src/api/types'; +import type { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient'; +import type { Domain } from '../../../src/domains/data'; +import type { ShlinkState } from '../../../src/container/types'; +import type { SelectedServer, ServerData } from '../../../src/servers/data'; import { parseApiError } from '../../../src/api/utils'; describe('domainsListReducer', () => { diff --git a/test/mercure/helpers/index.test.tsx b/test/mercure/helpers/index.test.tsx index 109e2b57..90a235da 100644 --- a/test/mercure/helpers/index.test.tsx +++ b/test/mercure/helpers/index.test.tsx @@ -2,7 +2,7 @@ import { EventSourcePolyfill } from 'event-source-polyfill'; import { Mock } from 'ts-mockery'; import { identity } from 'ramda'; import { bindToMercureTopic } from '../../../src/mercure/helpers'; -import { MercureInfo } from '../../../src/mercure/reducers/mercureInfo'; +import type { MercureInfo } from '../../../src/mercure/reducers/mercureInfo'; jest.mock('event-source-polyfill'); diff --git a/test/mercure/reducers/mercureInfo.test.ts b/test/mercure/reducers/mercureInfo.test.ts index 2dcc71b0..928137c2 100644 --- a/test/mercure/reducers/mercureInfo.test.ts +++ b/test/mercure/reducers/mercureInfo.test.ts @@ -1,7 +1,7 @@ import { Mock } from 'ts-mockery'; import { mercureInfoReducerCreator } from '../../../src/mercure/reducers/mercureInfo'; -import { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient'; -import { GetState } from '../../../src/container/types'; +import type { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient'; +import type { GetState } from '../../../src/container/types'; describe('mercureInfoReducer', () => { const mercureInfo = { diff --git a/test/servers/CreateServer.test.tsx b/test/servers/CreateServer.test.tsx index a5cbc674..7e063569 100644 --- a/test/servers/CreateServer.test.tsx +++ b/test/servers/CreateServer.test.tsx @@ -2,7 +2,7 @@ import { fireEvent, screen, waitFor } from '@testing-library/react'; import { Mock } from 'ts-mockery'; import { useNavigate } from 'react-router-dom'; import { CreateServer as createCreateServer } from '../../src/servers/CreateServer'; -import { ServerWithId } from '../../src/servers/data'; +import type { ServerWithId } from '../../src/servers/data'; import { renderWithEvents } from '../__helpers__/setUpTest'; jest.mock('react-router-dom', () => ({ ...jest.requireActual('react-router-dom'), useNavigate: jest.fn() })); diff --git a/test/servers/DeleteServerButton.test.tsx b/test/servers/DeleteServerButton.test.tsx index c26431e5..36b8f621 100644 --- a/test/servers/DeleteServerButton.test.tsx +++ b/test/servers/DeleteServerButton.test.tsx @@ -1,8 +1,8 @@ -import { ReactNode } from 'react'; +import type { ReactNode } from 'react'; import { screen, waitFor } from '@testing-library/react'; import { Mock } from 'ts-mockery'; import { DeleteServerButton as createDeleteServerButton } from '../../src/servers/DeleteServerButton'; -import { ServerWithId } from '../../src/servers/data'; +import type { ServerWithId } from '../../src/servers/data'; import { renderWithEvents } from '../__helpers__/setUpTest'; describe('', () => { diff --git a/test/servers/DeleteServerModal.test.tsx b/test/servers/DeleteServerModal.test.tsx index 0a5affe5..19b4916f 100644 --- a/test/servers/DeleteServerModal.test.tsx +++ b/test/servers/DeleteServerModal.test.tsx @@ -2,7 +2,7 @@ import { screen, waitFor } from '@testing-library/react'; import { Mock } from 'ts-mockery'; import { useNavigate } from 'react-router-dom'; import { DeleteServerModal } from '../../src/servers/DeleteServerModal'; -import { ServerWithId } from '../../src/servers/data'; +import type { ServerWithId } from '../../src/servers/data'; import { renderWithEvents } from '../__helpers__/setUpTest'; import { TestModalWrapper } from '../__helpers__/TestModalWrapper'; diff --git a/test/servers/EditServer.test.tsx b/test/servers/EditServer.test.tsx index c5181bc0..17ac44f4 100644 --- a/test/servers/EditServer.test.tsx +++ b/test/servers/EditServer.test.tsx @@ -2,7 +2,7 @@ import { fireEvent, screen } from '@testing-library/react'; import { Mock } from 'ts-mockery'; import { MemoryRouter, useNavigate } from 'react-router-dom'; import { EditServer as editServerConstruct } from '../../src/servers/EditServer'; -import { ReachableServer, SelectedServer } from '../../src/servers/data'; +import type { ReachableServer, SelectedServer } from '../../src/servers/data'; import { renderWithEvents } from '../__helpers__/setUpTest'; jest.mock('react-router-dom', () => ({ ...jest.requireActual('react-router-dom'), useNavigate: jest.fn() })); diff --git a/test/servers/ManageServers.test.tsx b/test/servers/ManageServers.test.tsx index f34ad465..375db005 100644 --- a/test/servers/ManageServers.test.tsx +++ b/test/servers/ManageServers.test.tsx @@ -1,9 +1,9 @@ import { Mock } from 'ts-mockery'; import { screen, waitFor } from '@testing-library/react'; import { MemoryRouter } from 'react-router-dom'; -import ServersExporter from '../../src/servers/services/ServersExporter'; +import type ServersExporter from '../../src/servers/services/ServersExporter'; import { ManageServers as createManageServers } from '../../src/servers/ManageServers'; -import { ServersMap, ServerWithId } from '../../src/servers/data'; +import type { ServersMap, ServerWithId } from '../../src/servers/data'; import { renderWithEvents } from '../__helpers__/setUpTest'; describe('', () => { diff --git a/test/servers/ManageServersRow.test.tsx b/test/servers/ManageServersRow.test.tsx index 7c3e24ff..d7a91aec 100644 --- a/test/servers/ManageServersRow.test.tsx +++ b/test/servers/ManageServersRow.test.tsx @@ -1,7 +1,7 @@ import { render, screen } from '@testing-library/react'; import { MemoryRouter } from 'react-router-dom'; import { ManageServersRow as createManageServersRow } from '../../src/servers/ManageServersRow'; -import { ServerWithId } from '../../src/servers/data'; +import type { ServerWithId } from '../../src/servers/data'; describe('', () => { const ManageServersRow = createManageServersRow(() => ManageServersRowDropdown); diff --git a/test/servers/ManageServersRowDropdown.test.tsx b/test/servers/ManageServersRowDropdown.test.tsx index 043950f0..d6da6dc8 100644 --- a/test/servers/ManageServersRowDropdown.test.tsx +++ b/test/servers/ManageServersRowDropdown.test.tsx @@ -1,7 +1,7 @@ import { screen } from '@testing-library/react'; import { Mock } from 'ts-mockery'; import { MemoryRouter } from 'react-router-dom'; -import { ServerWithId } from '../../src/servers/data'; +import type { ServerWithId } from '../../src/servers/data'; import { ManageServersRowDropdown as createManageServersRowDropdown } from '../../src/servers/ManageServersRowDropdown'; import { renderWithEvents } from '../__helpers__/setUpTest'; diff --git a/test/servers/Overview.test.tsx b/test/servers/Overview.test.tsx index 2cf05347..dc931bdc 100644 --- a/test/servers/Overview.test.tsx +++ b/test/servers/Overview.test.tsx @@ -1,12 +1,12 @@ import { render, screen } from '@testing-library/react'; import { Mock } from 'ts-mockery'; import { MemoryRouter } from 'react-router-dom'; -import { ShortUrlsList as ShortUrlsListState } from '../../src/short-urls/reducers/shortUrlsList'; +import type { ShortUrlsList as ShortUrlsListState } from '../../src/short-urls/reducers/shortUrlsList'; import { Overview as overviewCreator } from '../../src/servers/Overview'; -import { TagsList } from '../../src/tags/reducers/tagsList'; -import { VisitsOverview } from '../../src/visits/reducers/visitsOverview'; -import { MercureInfo } from '../../src/mercure/reducers/mercureInfo'; -import { ReachableServer } from '../../src/servers/data'; +import type { TagsList } from '../../src/tags/reducers/tagsList'; +import type { VisitsOverview } from '../../src/visits/reducers/visitsOverview'; +import type { MercureInfo } from '../../src/mercure/reducers/mercureInfo'; +import type { ReachableServer } from '../../src/servers/data'; import { prettify } from '../../src/utils/helpers/numbers'; describe('', () => { diff --git a/test/servers/ServersDropdown.test.tsx b/test/servers/ServersDropdown.test.tsx index 102cec91..ae281bd4 100644 --- a/test/servers/ServersDropdown.test.tsx +++ b/test/servers/ServersDropdown.test.tsx @@ -3,7 +3,7 @@ import { values } from 'ramda'; import { Mock } from 'ts-mockery'; import { MemoryRouter } from 'react-router-dom'; import { ServersDropdown } from '../../src/servers/ServersDropdown'; -import { ServersMap, ServerWithId } from '../../src/servers/data'; +import type { ServersMap, ServerWithId } from '../../src/servers/data'; import { renderWithEvents } from '../__helpers__/setUpTest'; describe('', () => { diff --git a/test/servers/ServersListGroup.test.tsx b/test/servers/ServersListGroup.test.tsx index 401777e7..3e716d46 100644 --- a/test/servers/ServersListGroup.test.tsx +++ b/test/servers/ServersListGroup.test.tsx @@ -2,7 +2,7 @@ import { render, screen } from '@testing-library/react'; import { Mock } from 'ts-mockery'; import { MemoryRouter } from 'react-router-dom'; import { ServersListGroup } from '../../src/servers/ServersListGroup'; -import { ServerWithId } from '../../src/servers/data'; +import type { ServerWithId } from '../../src/servers/data'; describe('', () => { const servers = [ diff --git a/test/servers/helpers/DuplicatedServersModal.test.tsx b/test/servers/helpers/DuplicatedServersModal.test.tsx index 0441b4e5..9172e801 100644 --- a/test/servers/helpers/DuplicatedServersModal.test.tsx +++ b/test/servers/helpers/DuplicatedServersModal.test.tsx @@ -1,7 +1,7 @@ import { screen } from '@testing-library/react'; import { Mock } from 'ts-mockery'; import { DuplicatedServersModal } from '../../../src/servers/helpers/DuplicatedServersModal'; -import { ServerData } from '../../../src/servers/data'; +import type { ServerData } from '../../../src/servers/data'; import { renderWithEvents } from '../../__helpers__/setUpTest'; describe('', () => { diff --git a/test/servers/helpers/HighlightCard.test.tsx b/test/servers/helpers/HighlightCard.test.tsx index 199fe4c9..afc8f070 100644 --- a/test/servers/helpers/HighlightCard.test.tsx +++ b/test/servers/helpers/HighlightCard.test.tsx @@ -1,7 +1,8 @@ import { render, screen } from '@testing-library/react'; -import { ReactNode } from 'react'; +import type { ReactNode } from 'react'; import { MemoryRouter } from 'react-router-dom'; -import { HighlightCard, HighlightCardProps } from '../../../src/servers/helpers/HighlightCard'; +import type { HighlightCardProps } from '../../../src/servers/helpers/HighlightCard'; +import { HighlightCard } from '../../../src/servers/helpers/HighlightCard'; describe('', () => { const setUp = (props: HighlightCardProps & { children?: ReactNode }) => render( diff --git a/test/servers/helpers/ImportServersBtn.test.tsx b/test/servers/helpers/ImportServersBtn.test.tsx index f60d21ad..c1d96fad 100644 --- a/test/servers/helpers/ImportServersBtn.test.tsx +++ b/test/servers/helpers/ImportServersBtn.test.tsx @@ -1,11 +1,12 @@ import { fireEvent, screen, waitFor } from '@testing-library/react'; import { Mock } from 'ts-mockery'; +import type { + ImportServersBtnProps } from '../../../src/servers/helpers/ImportServersBtn'; import { ImportServersBtn as createImportServersBtn, - ImportServersBtnProps, } from '../../../src/servers/helpers/ImportServersBtn'; -import { ServersImporter } from '../../../src/servers/services/ServersImporter'; -import { ServersMap, ServerWithId } from '../../../src/servers/data'; +import type { ServersImporter } from '../../../src/servers/services/ServersImporter'; +import type { ServersMap, ServerWithId } from '../../../src/servers/data'; import { renderWithEvents } from '../../__helpers__/setUpTest'; describe('', () => { diff --git a/test/servers/helpers/ServerError.test.tsx b/test/servers/helpers/ServerError.test.tsx index 88847c39..2b7b6bb5 100644 --- a/test/servers/helpers/ServerError.test.tsx +++ b/test/servers/helpers/ServerError.test.tsx @@ -2,7 +2,7 @@ import { render, screen } from '@testing-library/react'; import { MemoryRouter } from 'react-router-dom'; import { Mock } from 'ts-mockery'; import { ServerError as createServerError } from '../../../src/servers/helpers/ServerError'; -import { NonReachableServer, NotFoundServer } from '../../../src/servers/data'; +import type { NonReachableServer, NotFoundServer } from '../../../src/servers/data'; describe('', () => { const ServerError = createServerError(() => null); diff --git a/test/servers/reducers/remoteServers.test.ts b/test/servers/reducers/remoteServers.test.ts index 2c717696..60905535 100644 --- a/test/servers/reducers/remoteServers.test.ts +++ b/test/servers/reducers/remoteServers.test.ts @@ -1,7 +1,7 @@ import { Mock } from 'ts-mockery'; import { fetchServers } from '../../../src/servers/reducers/remoteServers'; import { createServers } from '../../../src/servers/reducers/servers'; -import { HttpClient } from '../../../src/common/services/HttpClient'; +import type { HttpClient } from '../../../src/common/services/HttpClient'; describe('remoteServersReducer', () => { afterEach(jest.clearAllMocks); diff --git a/test/servers/reducers/selectedServer.test.ts b/test/servers/reducers/selectedServer.test.ts index bbb93798..e6fe50b7 100644 --- a/test/servers/reducers/selectedServer.test.ts +++ b/test/servers/reducers/selectedServer.test.ts @@ -8,9 +8,9 @@ import { MAX_FALLBACK_VERSION, MIN_FALLBACK_VERSION, } from '../../../src/servers/reducers/selectedServer'; -import { ShlinkState } from '../../../src/container/types'; -import { NonReachableServer, NotFoundServer, ReachableServer, RegularServer } from '../../../src/servers/data'; -import { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient'; +import type { ShlinkState } from '../../../src/container/types'; +import type { NonReachableServer, NotFoundServer, ReachableServer, RegularServer } from '../../../src/servers/data'; +import type { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient'; describe('selectedServerReducer', () => { const dispatch = jest.fn(); diff --git a/test/servers/reducers/servers.test.ts b/test/servers/reducers/servers.test.ts index 81695779..10c41c80 100644 --- a/test/servers/reducers/servers.test.ts +++ b/test/servers/reducers/servers.test.ts @@ -7,7 +7,7 @@ import { setAutoConnect, serversReducer, } from '../../../src/servers/reducers/servers'; -import { RegularServer } from '../../../src/servers/data'; +import type { RegularServer } from '../../../src/servers/data'; describe('serversReducer', () => { const list = { diff --git a/test/servers/services/ServersExporter.test.ts b/test/servers/services/ServersExporter.test.ts index 0aa73ec1..cab4b056 100644 --- a/test/servers/services/ServersExporter.test.ts +++ b/test/servers/services/ServersExporter.test.ts @@ -1,6 +1,6 @@ import { Mock } from 'ts-mockery'; import ServersExporter from '../../../src/servers/services/ServersExporter'; -import { LocalStorage } from '../../../src/utils/services/LocalStorage'; +import type { LocalStorage } from '../../../src/utils/services/LocalStorage'; import { appendChild, removeChild, windowMock } from '../../__mocks__/Window.mock'; describe('ServersExporter', () => { diff --git a/test/servers/services/ServersImporter.test.ts b/test/servers/services/ServersImporter.test.ts index dee01be0..f57b1d73 100644 --- a/test/servers/services/ServersImporter.test.ts +++ b/test/servers/services/ServersImporter.test.ts @@ -1,6 +1,6 @@ import { Mock } from 'ts-mockery'; import { ServersImporter } from '../../../src/servers/services/ServersImporter'; -import { RegularServer } from '../../../src/servers/data'; +import type { RegularServer } from '../../../src/servers/data'; describe('ServersImporter', () => { const servers: RegularServer[] = [Mock.all(), Mock.all()]; diff --git a/test/settings/RealTimeUpdatesSettings.test.tsx b/test/settings/RealTimeUpdatesSettings.test.tsx index 943f8157..602012b6 100644 --- a/test/settings/RealTimeUpdatesSettings.test.tsx +++ b/test/settings/RealTimeUpdatesSettings.test.tsx @@ -1,6 +1,6 @@ import { screen } from '@testing-library/react'; import { Mock } from 'ts-mockery'; -import { +import type { RealTimeUpdatesSettings as RealTimeUpdatesSettingsOptions, Settings, } from '../../src/settings/reducers/settings'; diff --git a/test/settings/ShortUrlCreationSettings.test.tsx b/test/settings/ShortUrlCreationSettings.test.tsx index 57ea949a..ea04b93f 100644 --- a/test/settings/ShortUrlCreationSettings.test.tsx +++ b/test/settings/ShortUrlCreationSettings.test.tsx @@ -1,6 +1,6 @@ import { screen } from '@testing-library/react'; import { Mock } from 'ts-mockery'; -import { ShortUrlCreationSettings as ShortUrlsSettings, Settings } from '../../src/settings/reducers/settings'; +import type { ShortUrlCreationSettings as ShortUrlsSettings, Settings } from '../../src/settings/reducers/settings'; import { ShortUrlCreationSettings } from '../../src/settings/ShortUrlCreationSettings'; import { renderWithEvents } from '../__helpers__/setUpTest'; diff --git a/test/settings/ShortUrlsListSettings.test.tsx b/test/settings/ShortUrlsListSettings.test.tsx index 53350a0e..c0cd1a4b 100644 --- a/test/settings/ShortUrlsListSettings.test.tsx +++ b/test/settings/ShortUrlsListSettings.test.tsx @@ -1,8 +1,8 @@ import { screen } from '@testing-library/react'; import { Mock } from 'ts-mockery'; -import { Settings, ShortUrlsListSettings as ShortUrlsSettings } from '../../src/settings/reducers/settings'; +import type { Settings, ShortUrlsListSettings as ShortUrlsSettings } from '../../src/settings/reducers/settings'; import { ShortUrlsListSettings } from '../../src/settings/ShortUrlsListSettings'; -import { ShortUrlsOrder } from '../../src/short-urls/data'; +import type { ShortUrlsOrder } from '../../src/short-urls/data'; import { renderWithEvents } from '../__helpers__/setUpTest'; describe('', () => { diff --git a/test/settings/TagsSettings.test.tsx b/test/settings/TagsSettings.test.tsx index d1b56f05..050e4b1c 100644 --- a/test/settings/TagsSettings.test.tsx +++ b/test/settings/TagsSettings.test.tsx @@ -1,8 +1,8 @@ import { screen } from '@testing-library/react'; import { Mock } from 'ts-mockery'; -import { Settings, TagsSettings as TagsSettingsOptions } from '../../src/settings/reducers/settings'; +import type { Settings, TagsSettings as TagsSettingsOptions } from '../../src/settings/reducers/settings'; import { TagsSettings } from '../../src/settings/TagsSettings'; -import { TagsOrder } from '../../src/tags/data/TagsListChildrenProps'; +import type { TagsOrder } from '../../src/tags/data/TagsListChildrenProps'; import { renderWithEvents } from '../__helpers__/setUpTest'; describe('', () => { diff --git a/test/settings/UserInterfaceSettings.test.tsx b/test/settings/UserInterfaceSettings.test.tsx index 12270b37..0ca68e86 100644 --- a/test/settings/UserInterfaceSettings.test.tsx +++ b/test/settings/UserInterfaceSettings.test.tsx @@ -1,8 +1,8 @@ import { screen } from '@testing-library/react'; import { Mock } from 'ts-mockery'; -import { Settings, UiSettings } from '../../src/settings/reducers/settings'; +import type { Settings, UiSettings } from '../../src/settings/reducers/settings'; import { UserInterfaceSettings } from '../../src/settings/UserInterfaceSettings'; -import { Theme } from '../../src/utils/theme'; +import type { Theme } from '../../src/utils/theme'; import { renderWithEvents } from '../__helpers__/setUpTest'; describe('', () => { diff --git a/test/settings/VisitsSettings.test.tsx b/test/settings/VisitsSettings.test.tsx index 051bdcf4..3326b75e 100644 --- a/test/settings/VisitsSettings.test.tsx +++ b/test/settings/VisitsSettings.test.tsx @@ -1,6 +1,6 @@ import { screen } from '@testing-library/react'; import { Mock } from 'ts-mockery'; -import { Settings } from '../../src/settings/reducers/settings'; +import type { Settings } from '../../src/settings/reducers/settings'; import { VisitsSettings } from '../../src/settings/VisitsSettings'; import { renderWithEvents } from '../__helpers__/setUpTest'; diff --git a/test/settings/helpers/index.test.ts b/test/settings/helpers/index.test.ts index 0808ad35..96fa27b8 100644 --- a/test/settings/helpers/index.test.ts +++ b/test/settings/helpers/index.test.ts @@ -1,6 +1,6 @@ import { Mock } from 'ts-mockery'; import { migrateDeprecatedSettings } from '../../../src/settings/helpers'; -import { ShlinkState } from '../../../src/container/types'; +import type { ShlinkState } from '../../../src/container/types'; describe('settings-helpers', () => { describe('migrateDeprecatedSettings', () => { diff --git a/test/short-urls/CreateShortUrl.test.tsx b/test/short-urls/CreateShortUrl.test.tsx index 2e53e8dc..208d9cd8 100644 --- a/test/short-urls/CreateShortUrl.test.tsx +++ b/test/short-urls/CreateShortUrl.test.tsx @@ -1,8 +1,8 @@ import { render, screen } from '@testing-library/react'; import { Mock } from 'ts-mockery'; import { CreateShortUrl as createShortUrlsCreator } from '../../src/short-urls/CreateShortUrl'; -import { ShortUrlCreation } from '../../src/short-urls/reducers/shortUrlCreation'; -import { Settings } from '../../src/settings/reducers/settings'; +import type { ShortUrlCreation } from '../../src/short-urls/reducers/shortUrlCreation'; +import type { Settings } from '../../src/settings/reducers/settings'; describe('', () => { const ShortUrlForm = () => ShortUrlForm; diff --git a/test/short-urls/EditShortUrl.test.tsx b/test/short-urls/EditShortUrl.test.tsx index 8af59969..e262f2ed 100644 --- a/test/short-urls/EditShortUrl.test.tsx +++ b/test/short-urls/EditShortUrl.test.tsx @@ -2,10 +2,10 @@ import { render, screen } from '@testing-library/react'; import { MemoryRouter } from 'react-router-dom'; import { Mock } from 'ts-mockery'; import { EditShortUrl as createEditShortUrl } from '../../src/short-urls/EditShortUrl'; -import { Settings } from '../../src/settings/reducers/settings'; -import { ShortUrlDetail } from '../../src/short-urls/reducers/shortUrlDetail'; -import { ShortUrlEdition } from '../../src/short-urls/reducers/shortUrlEdition'; -import { ShortUrl } from '../../src/short-urls/data'; +import type { Settings } from '../../src/settings/reducers/settings'; +import type { ShortUrlDetail } from '../../src/short-urls/reducers/shortUrlDetail'; +import type { ShortUrlEdition } from '../../src/short-urls/reducers/shortUrlEdition'; +import type { ShortUrl } from '../../src/short-urls/data'; describe('', () => { const shortUrlCreation = { validateUrls: true }; diff --git a/test/short-urls/Paginator.test.tsx b/test/short-urls/Paginator.test.tsx index a40a62d8..22a8f017 100644 --- a/test/short-urls/Paginator.test.tsx +++ b/test/short-urls/Paginator.test.tsx @@ -2,7 +2,7 @@ import { render, screen } from '@testing-library/react'; import { Mock } from 'ts-mockery'; import { MemoryRouter } from 'react-router-dom'; import { Paginator } from '../../src/short-urls/Paginator'; -import { ShlinkPaginator } from '../../src/api/types'; +import type { ShlinkPaginator } from '../../src/api/types'; import { ELLIPSIS } from '../../src/utils/helpers/pagination'; describe('', () => { diff --git a/test/short-urls/ShortUrlForm.test.tsx b/test/short-urls/ShortUrlForm.test.tsx index 2709a7f8..5083a7b0 100644 --- a/test/short-urls/ShortUrlForm.test.tsx +++ b/test/short-urls/ShortUrlForm.test.tsx @@ -1,11 +1,12 @@ import { screen } from '@testing-library/react'; -import { UserEvent } from '@testing-library/user-event/setup/setup'; +import type { UserEvent } from '@testing-library/user-event/setup/setup'; import { formatISO } from 'date-fns'; import { Mock } from 'ts-mockery'; -import { ShortUrlForm as createShortUrlForm, Mode } from '../../src/short-urls/ShortUrlForm'; -import { ReachableServer, SelectedServer } from '../../src/servers/data'; +import type { Mode } from '../../src/short-urls/ShortUrlForm'; +import { ShortUrlForm as createShortUrlForm } from '../../src/short-urls/ShortUrlForm'; +import type { ReachableServer, SelectedServer } from '../../src/servers/data'; import { parseDate } from '../../src/utils/helpers/date'; -import { OptionalString } from '../../src/utils/utils'; +import type { OptionalString } from '../../src/utils/utils'; import { renderWithEvents } from '../__helpers__/setUpTest'; describe('', () => { diff --git a/test/short-urls/ShortUrlsFilteringBar.test.tsx b/test/short-urls/ShortUrlsFilteringBar.test.tsx index 5c89c865..e60440c8 100644 --- a/test/short-urls/ShortUrlsFilteringBar.test.tsx +++ b/test/short-urls/ShortUrlsFilteringBar.test.tsx @@ -3,9 +3,9 @@ import { Mock } from 'ts-mockery'; import { endOfDay, formatISO, startOfDay } from 'date-fns'; import { MemoryRouter, useLocation, useNavigate } from 'react-router-dom'; import { ShortUrlsFilteringBar as filteringBarCreator } from '../../src/short-urls/ShortUrlsFilteringBar'; -import { ReachableServer, SelectedServer } from '../../src/servers/data'; -import { Settings } from '../../src/settings/reducers/settings'; -import { DateRange } from '../../src/utils/helpers/dateIntervals'; +import type { ReachableServer, SelectedServer } from '../../src/servers/data'; +import type { Settings } from '../../src/settings/reducers/settings'; +import type { DateRange } from '../../src/utils/helpers/dateIntervals'; import { formatDate } from '../../src/utils/helpers/date'; import { renderWithEvents } from '../__helpers__/setUpTest'; diff --git a/test/short-urls/ShortUrlsList.test.tsx b/test/short-urls/ShortUrlsList.test.tsx index 12a81188..b62c32a0 100644 --- a/test/short-urls/ShortUrlsList.test.tsx +++ b/test/short-urls/ShortUrlsList.test.tsx @@ -2,14 +2,14 @@ import { screen } from '@testing-library/react'; import { Mock } from 'ts-mockery'; import { MemoryRouter, useNavigate } from 'react-router-dom'; import { ShortUrlsList as createShortUrlsList } from '../../src/short-urls/ShortUrlsList'; -import { ShortUrl, ShortUrlsOrder } from '../../src/short-urls/data'; -import { MercureBoundProps } from '../../src/mercure/helpers/boundToMercureHub'; -import { ShortUrlsList as ShortUrlsListModel } from '../../src/short-urls/reducers/shortUrlsList'; -import { ReachableServer } from '../../src/servers/data'; -import { Settings } from '../../src/settings/reducers/settings'; -import { ShortUrlsTableType } from '../../src/short-urls/ShortUrlsTable'; +import type { ShortUrl, ShortUrlsOrder } from '../../src/short-urls/data'; +import type { MercureBoundProps } from '../../src/mercure/helpers/boundToMercureHub'; +import type { ShortUrlsList as ShortUrlsListModel } from '../../src/short-urls/reducers/shortUrlsList'; +import type { ReachableServer } from '../../src/servers/data'; +import type { Settings } from '../../src/settings/reducers/settings'; +import type { ShortUrlsTableType } from '../../src/short-urls/ShortUrlsTable'; import { renderWithEvents } from '../__helpers__/setUpTest'; -import { SemVer } from '../../src/utils/helpers/version'; +import type { SemVer } from '../../src/utils/helpers/version'; jest.mock('react-router-dom', () => ({ ...jest.requireActual('react-router-dom'), diff --git a/test/short-urls/ShortUrlsTable.test.tsx b/test/short-urls/ShortUrlsTable.test.tsx index c3fded0a..fc50625b 100644 --- a/test/short-urls/ShortUrlsTable.test.tsx +++ b/test/short-urls/ShortUrlsTable.test.tsx @@ -1,9 +1,10 @@ import { fireEvent, screen } from '@testing-library/react'; import { Mock } from 'ts-mockery'; import { ShortUrlsTable as shortUrlsTableCreator } from '../../src/short-urls/ShortUrlsTable'; -import { ShortUrlsList } from '../../src/short-urls/reducers/shortUrlsList'; -import { ReachableServer, SelectedServer } from '../../src/servers/data'; -import { ShortUrlsOrderableFields, SHORT_URLS_ORDERABLE_FIELDS } from '../../src/short-urls/data'; +import type { ShortUrlsList } from '../../src/short-urls/reducers/shortUrlsList'; +import type { ReachableServer, SelectedServer } from '../../src/servers/data'; +import type { ShortUrlsOrderableFields } from '../../src/short-urls/data'; +import { SHORT_URLS_ORDERABLE_FIELDS } from '../../src/short-urls/data'; import { renderWithEvents } from '../__helpers__/setUpTest'; describe('', () => { diff --git a/test/short-urls/helpers/CreateShortUrlResult.test.tsx b/test/short-urls/helpers/CreateShortUrlResult.test.tsx index 404ab833..4d5839fb 100644 --- a/test/short-urls/helpers/CreateShortUrlResult.test.tsx +++ b/test/short-urls/helpers/CreateShortUrlResult.test.tsx @@ -1,10 +1,10 @@ import { screen } from '@testing-library/react'; import { Mock } from 'ts-mockery'; import { CreateShortUrlResult as createResult } from '../../../src/short-urls/helpers/CreateShortUrlResult'; -import { ShortUrl } from '../../../src/short-urls/data'; -import { TimeoutToggle } from '../../../src/utils/helpers/hooks'; +import type { ShortUrl } from '../../../src/short-urls/data'; +import type { TimeoutToggle } from '../../../src/utils/helpers/hooks'; import { renderWithEvents } from '../../__helpers__/setUpTest'; -import { ShortUrlCreation } from '../../../src/short-urls/reducers/shortUrlCreation'; +import type { ShortUrlCreation } from '../../../src/short-urls/reducers/shortUrlCreation'; describe('', () => { const copyToClipboard = jest.fn(); diff --git a/test/short-urls/helpers/DeleteShortUrlModal.test.tsx b/test/short-urls/helpers/DeleteShortUrlModal.test.tsx index a71cd977..14ed94a8 100644 --- a/test/short-urls/helpers/DeleteShortUrlModal.test.tsx +++ b/test/short-urls/helpers/DeleteShortUrlModal.test.tsx @@ -1,10 +1,11 @@ import { screen, waitFor } from '@testing-library/react'; import { Mock } from 'ts-mockery'; import { DeleteShortUrlModal } from '../../../src/short-urls/helpers/DeleteShortUrlModal'; -import { ShortUrl } from '../../../src/short-urls/data'; -import { ShortUrlDeletion } from '../../../src/short-urls/reducers/shortUrlDeletion'; +import type { ShortUrl } from '../../../src/short-urls/data'; +import type { ShortUrlDeletion } from '../../../src/short-urls/reducers/shortUrlDeletion'; import { renderWithEvents } from '../../__helpers__/setUpTest'; -import { ErrorTypeV2, ErrorTypeV3, InvalidShortUrlDeletion, ProblemDetailsError } from '../../../src/api/types/errors'; +import type { InvalidShortUrlDeletion, ProblemDetailsError } from '../../../src/api/types/errors'; +import { ErrorTypeV2, ErrorTypeV3 } from '../../../src/api/types/errors'; import { TestModalWrapper } from '../../__helpers__/TestModalWrapper'; describe('', () => { diff --git a/test/short-urls/helpers/ExportShortUrlsBtn.test.tsx b/test/short-urls/helpers/ExportShortUrlsBtn.test.tsx index e2af62af..ab35d1e9 100644 --- a/test/short-urls/helpers/ExportShortUrlsBtn.test.tsx +++ b/test/short-urls/helpers/ExportShortUrlsBtn.test.tsx @@ -1,9 +1,9 @@ import { Mock } from 'ts-mockery'; import { screen } from '@testing-library/react'; import { MemoryRouter } from 'react-router-dom'; -import { ReportExporter } from '../../../src/common/services/ReportExporter'; +import type { ReportExporter } from '../../../src/common/services/ReportExporter'; import { ExportShortUrlsBtn as createExportShortUrlsBtn } from '../../../src/short-urls/helpers/ExportShortUrlsBtn'; -import { NotFoundServer, ReachableServer, SelectedServer } from '../../../src/servers/data'; +import type { NotFoundServer, ReachableServer, SelectedServer } from '../../../src/servers/data'; import { renderWithEvents } from '../../__helpers__/setUpTest'; describe('', () => { diff --git a/test/short-urls/helpers/QrCodeModal.test.tsx b/test/short-urls/helpers/QrCodeModal.test.tsx index 12bcad54..51c2566a 100644 --- a/test/short-urls/helpers/QrCodeModal.test.tsx +++ b/test/short-urls/helpers/QrCodeModal.test.tsx @@ -1,10 +1,10 @@ import { fireEvent, screen } from '@testing-library/react'; import { Mock } from 'ts-mockery'; import { QrCodeModal as createQrCodeModal } from '../../../src/short-urls/helpers/QrCodeModal'; -import { ShortUrl } from '../../../src/short-urls/data'; -import { ReachableServer } from '../../../src/servers/data'; -import { SemVer } from '../../../src/utils/helpers/version'; -import { ImageDownloader } from '../../../src/common/services/ImageDownloader'; +import type { ShortUrl } from '../../../src/short-urls/data'; +import type { ReachableServer } from '../../../src/servers/data'; +import type { SemVer } from '../../../src/utils/helpers/version'; +import type { ImageDownloader } from '../../../src/common/services/ImageDownloader'; import { renderWithEvents } from '../../__helpers__/setUpTest'; describe('', () => { diff --git a/test/short-urls/helpers/ShortUrlDetailLink.test.tsx b/test/short-urls/helpers/ShortUrlDetailLink.test.tsx index 3c38216e..7c8a91ce 100644 --- a/test/short-urls/helpers/ShortUrlDetailLink.test.tsx +++ b/test/short-urls/helpers/ShortUrlDetailLink.test.tsx @@ -1,9 +1,10 @@ import { render, screen } from '@testing-library/react'; import { Mock } from 'ts-mockery'; import { MemoryRouter } from 'react-router-dom'; -import { ShortUrlDetailLink, LinkSuffix } from '../../../src/short-urls/helpers/ShortUrlDetailLink'; -import { NotFoundServer, ReachableServer } from '../../../src/servers/data'; -import { ShortUrl } from '../../../src/short-urls/data'; +import type { LinkSuffix } from '../../../src/short-urls/helpers/ShortUrlDetailLink'; +import { ShortUrlDetailLink } from '../../../src/short-urls/helpers/ShortUrlDetailLink'; +import type { NotFoundServer, ReachableServer } from '../../../src/servers/data'; +import type { ShortUrl } from '../../../src/short-urls/data'; describe('', () => { it.each([ diff --git a/test/short-urls/helpers/ShortUrlStatus.test.tsx b/test/short-urls/helpers/ShortUrlStatus.test.tsx index 8c689086..5935aa78 100644 --- a/test/short-urls/helpers/ShortUrlStatus.test.tsx +++ b/test/short-urls/helpers/ShortUrlStatus.test.tsx @@ -2,7 +2,7 @@ import userEvent from '@testing-library/user-event'; import { render, screen, waitFor } from '@testing-library/react'; import { Mock } from 'ts-mockery'; import { ShortUrlStatus } from '../../../src/short-urls/helpers/ShortUrlStatus'; -import { ShortUrl, ShortUrlMeta, ShortUrlVisitsSummary } from '../../../src/short-urls/data'; +import type { ShortUrl, ShortUrlMeta, ShortUrlVisitsSummary } from '../../../src/short-urls/data'; describe('', () => { const setUp = (shortUrl: ShortUrl) => ({ diff --git a/test/short-urls/helpers/ShortUrlVisitsCount.test.tsx b/test/short-urls/helpers/ShortUrlVisitsCount.test.tsx index 2bf13db7..0dd502a8 100644 --- a/test/short-urls/helpers/ShortUrlVisitsCount.test.tsx +++ b/test/short-urls/helpers/ShortUrlVisitsCount.test.tsx @@ -2,7 +2,7 @@ import { render, screen, waitFor } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import { Mock } from 'ts-mockery'; import { ShortUrlVisitsCount } from '../../../src/short-urls/helpers/ShortUrlVisitsCount'; -import { ShortUrl } from '../../../src/short-urls/data'; +import type { ShortUrl } from '../../../src/short-urls/data'; describe('', () => { const setUp = (visitsCount: number, shortUrl: ShortUrl) => ({ diff --git a/test/short-urls/helpers/ShortUrlsRow.test.tsx b/test/short-urls/helpers/ShortUrlsRow.test.tsx index e81ce8e6..d6210e47 100644 --- a/test/short-urls/helpers/ShortUrlsRow.test.tsx +++ b/test/short-urls/helpers/ShortUrlsRow.test.tsx @@ -4,13 +4,13 @@ import { Mock } from 'ts-mockery'; import { addDays, formatISO, subDays } from 'date-fns'; import { MemoryRouter, useLocation } from 'react-router-dom'; import { ShortUrlsRow as createShortUrlsRow } from '../../../src/short-urls/helpers/ShortUrlsRow'; -import { TimeoutToggle } from '../../../src/utils/helpers/hooks'; -import { ShortUrl, ShortUrlMeta } from '../../../src/short-urls/data'; -import { Settings } from '../../../src/settings/reducers/settings'; -import { ReachableServer } from '../../../src/servers/data'; +import type { TimeoutToggle } from '../../../src/utils/helpers/hooks'; +import type { ShortUrl, ShortUrlMeta } from '../../../src/short-urls/data'; +import type { Settings } from '../../../src/settings/reducers/settings'; +import type { ReachableServer } from '../../../src/servers/data'; import { parseDate, now } from '../../../src/utils/helpers/date'; import { renderWithEvents } from '../../__helpers__/setUpTest'; -import { OptionalString } from '../../../src/utils/utils'; +import type { OptionalString } from '../../../src/utils/utils'; import { colorGeneratorMock } from '../../utils/services/__mocks__/ColorGenerator.mock'; interface SetUpOptions { diff --git a/test/short-urls/helpers/ShortUrlsRowMenu.test.tsx b/test/short-urls/helpers/ShortUrlsRowMenu.test.tsx index c0324e50..8a879d16 100644 --- a/test/short-urls/helpers/ShortUrlsRowMenu.test.tsx +++ b/test/short-urls/helpers/ShortUrlsRowMenu.test.tsx @@ -2,8 +2,8 @@ import { screen } from '@testing-library/react'; import { Mock } from 'ts-mockery'; import { MemoryRouter } from 'react-router-dom'; import { ShortUrlsRowMenu as createShortUrlsRowMenu } from '../../../src/short-urls/helpers/ShortUrlsRowMenu'; -import { ReachableServer } from '../../../src/servers/data'; -import { ShortUrl } from '../../../src/short-urls/data'; +import type { ReachableServer } from '../../../src/servers/data'; +import type { ShortUrl } from '../../../src/short-urls/data'; import { renderWithEvents } from '../../__helpers__/setUpTest'; describe('', () => { diff --git a/test/short-urls/helpers/index.test.ts b/test/short-urls/helpers/index.test.ts index 06415123..bc33c1d5 100644 --- a/test/short-urls/helpers/index.test.ts +++ b/test/short-urls/helpers/index.test.ts @@ -1,5 +1,5 @@ import { Mock } from 'ts-mockery'; -import { ShortUrl } from '../../../src/short-urls/data'; +import type { ShortUrl } from '../../../src/short-urls/data'; import { shortUrlDataFromShortUrl, urlDecodeShortCode, urlEncodeShortCode } from '../../../src/short-urls/helpers'; describe('helpers', () => { diff --git a/test/short-urls/helpers/qr-codes/QrErrorCorrectionDropdown.test.tsx b/test/short-urls/helpers/qr-codes/QrErrorCorrectionDropdown.test.tsx index ae20d61f..432e3c66 100644 --- a/test/short-urls/helpers/qr-codes/QrErrorCorrectionDropdown.test.tsx +++ b/test/short-urls/helpers/qr-codes/QrErrorCorrectionDropdown.test.tsx @@ -1,5 +1,5 @@ import { screen } from '@testing-library/react'; -import { QrErrorCorrection } from '../../../../src/utils/helpers/qrCodes'; +import type { QrErrorCorrection } from '../../../../src/utils/helpers/qrCodes'; import { QrErrorCorrectionDropdown } from '../../../../src/short-urls/helpers/qr-codes/QrErrorCorrectionDropdown'; import { renderWithEvents } from '../../../__helpers__/setUpTest'; diff --git a/test/short-urls/helpers/qr-codes/QrFormatDropdown.test.tsx b/test/short-urls/helpers/qr-codes/QrFormatDropdown.test.tsx index 499a5e89..eccfbcfb 100644 --- a/test/short-urls/helpers/qr-codes/QrFormatDropdown.test.tsx +++ b/test/short-urls/helpers/qr-codes/QrFormatDropdown.test.tsx @@ -1,5 +1,5 @@ import { screen } from '@testing-library/react'; -import { QrCodeFormat } from '../../../../src/utils/helpers/qrCodes'; +import type { QrCodeFormat } from '../../../../src/utils/helpers/qrCodes'; import { QrFormatDropdown } from '../../../../src/short-urls/helpers/qr-codes/QrFormatDropdown'; import { renderWithEvents } from '../../../__helpers__/setUpTest'; diff --git a/test/short-urls/reducers/shortUrlCreation.test.ts b/test/short-urls/reducers/shortUrlCreation.test.ts index f7815b4a..e231f7fb 100644 --- a/test/short-urls/reducers/shortUrlCreation.test.ts +++ b/test/short-urls/reducers/shortUrlCreation.test.ts @@ -1,12 +1,13 @@ import { Mock } from 'ts-mockery'; +import type { + CreateShortUrlAction } from '../../../src/short-urls/reducers/shortUrlCreation'; import { - CreateShortUrlAction, shortUrlCreationReducerCreator, createShortUrl as createShortUrlCreator, } from '../../../src/short-urls/reducers/shortUrlCreation'; -import { ShortUrl } from '../../../src/short-urls/data'; -import { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient'; -import { ShlinkState } from '../../../src/container/types'; +import type { ShortUrl } from '../../../src/short-urls/data'; +import type { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient'; +import type { ShlinkState } from '../../../src/container/types'; describe('shortUrlCreationReducer', () => { const shortUrl = Mock.of(); diff --git a/test/short-urls/reducers/shortUrlDeletion.test.ts b/test/short-urls/reducers/shortUrlDeletion.test.ts index e6bd8162..4b8eda22 100644 --- a/test/short-urls/reducers/shortUrlDeletion.test.ts +++ b/test/short-urls/reducers/shortUrlDeletion.test.ts @@ -3,8 +3,8 @@ import { shortUrlDeletionReducerCreator, deleteShortUrl as deleteShortUrlCretor, } from '../../../src/short-urls/reducers/shortUrlDeletion'; -import { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient'; -import { ProblemDetailsError } from '../../../src/api/types/errors'; +import type { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient'; +import type { ProblemDetailsError } from '../../../src/api/types/errors'; describe('shortUrlDeletionReducer', () => { const deleteShortUrlCall = jest.fn(); diff --git a/test/short-urls/reducers/shortUrlDetail.test.ts b/test/short-urls/reducers/shortUrlDetail.test.ts index cb745724..faa2ae2f 100644 --- a/test/short-urls/reducers/shortUrlDetail.test.ts +++ b/test/short-urls/reducers/shortUrlDetail.test.ts @@ -1,9 +1,10 @@ import { Mock } from 'ts-mockery'; -import { ShortUrlDetailAction, shortUrlDetailReducerCreator } from '../../../src/short-urls/reducers/shortUrlDetail'; -import { ShortUrl } from '../../../src/short-urls/data'; -import { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient'; -import { ShlinkState } from '../../../src/container/types'; -import { ShortUrlsList } from '../../../src/short-urls/reducers/shortUrlsList'; +import type { ShortUrlDetailAction } from '../../../src/short-urls/reducers/shortUrlDetail'; +import { shortUrlDetailReducerCreator } from '../../../src/short-urls/reducers/shortUrlDetail'; +import type { ShortUrl } from '../../../src/short-urls/data'; +import type { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient'; +import type { ShlinkState } from '../../../src/container/types'; +import type { ShortUrlsList } from '../../../src/short-urls/reducers/shortUrlsList'; describe('shortUrlDetailReducer', () => { const getShortUrlCall = jest.fn(); diff --git a/test/short-urls/reducers/shortUrlEdition.test.ts b/test/short-urls/reducers/shortUrlEdition.test.ts index 941328c8..37deb5e5 100644 --- a/test/short-urls/reducers/shortUrlEdition.test.ts +++ b/test/short-urls/reducers/shortUrlEdition.test.ts @@ -1,12 +1,13 @@ import { Mock } from 'ts-mockery'; +import type { + ShortUrlEditedAction } from '../../../src/short-urls/reducers/shortUrlEdition'; import { - ShortUrlEditedAction, shortUrlEditionReducerCreator, editShortUrl as editShortUrlCreator, } from '../../../src/short-urls/reducers/shortUrlEdition'; -import { ShlinkState } from '../../../src/container/types'; -import { ShortUrl } from '../../../src/short-urls/data'; -import { SelectedServer } from '../../../src/servers/data'; +import type { ShlinkState } from '../../../src/container/types'; +import type { ShortUrl } from '../../../src/short-urls/data'; +import type { SelectedServer } from '../../../src/servers/data'; describe('shortUrlEditionReducer', () => { const longUrl = 'https://shlink.io'; diff --git a/test/short-urls/reducers/shortUrlsList.test.ts b/test/short-urls/reducers/shortUrlsList.test.ts index 8e639603..4e0dd32a 100644 --- a/test/short-urls/reducers/shortUrlsList.test.ts +++ b/test/short-urls/reducers/shortUrlsList.test.ts @@ -4,12 +4,12 @@ import { shortUrlsListReducerCreator, } from '../../../src/short-urls/reducers/shortUrlsList'; import { shortUrlDeleted } from '../../../src/short-urls/reducers/shortUrlDeletion'; -import { ShlinkPaginator, ShlinkShortUrlsResponse } from '../../../src/api/types'; +import type { ShlinkPaginator, ShlinkShortUrlsResponse } from '../../../src/api/types'; import { createShortUrl as createShortUrlCreator } from '../../../src/short-urls/reducers/shortUrlCreation'; import { editShortUrl as editShortUrlCreator } from '../../../src/short-urls/reducers/shortUrlEdition'; import { createNewVisits } from '../../../src/visits/reducers/visitCreation'; -import { ShortUrl } from '../../../src/short-urls/data'; -import { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient'; +import type { ShortUrl } from '../../../src/short-urls/data'; +import type { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient'; describe('shortUrlsListReducer', () => { const shortCode = 'abc123'; diff --git a/test/tags/TagsList.test.tsx b/test/tags/TagsList.test.tsx index 9e47ffcb..fe659c55 100644 --- a/test/tags/TagsList.test.tsx +++ b/test/tags/TagsList.test.tsx @@ -1,10 +1,11 @@ import { screen, waitFor } from '@testing-library/react'; import { identity } from 'ramda'; import { Mock } from 'ts-mockery'; -import { TagsList as createTagsList, TagsListProps } from '../../src/tags/TagsList'; -import { TagsList } from '../../src/tags/reducers/tagsList'; -import { MercureBoundProps } from '../../src/mercure/helpers/boundToMercureHub'; -import { Settings } from '../../src/settings/reducers/settings'; +import type { TagsListProps } from '../../src/tags/TagsList'; +import { TagsList as createTagsList } from '../../src/tags/TagsList'; +import type { TagsList } from '../../src/tags/reducers/tagsList'; +import type { MercureBoundProps } from '../../src/mercure/helpers/boundToMercureHub'; +import type { Settings } from '../../src/settings/reducers/settings'; import { renderWithEvents } from '../__helpers__/setUpTest'; describe('', () => { diff --git a/test/tags/TagsTable.test.tsx b/test/tags/TagsTable.test.tsx index aae618ec..7c9d7da0 100644 --- a/test/tags/TagsTable.test.tsx +++ b/test/tags/TagsTable.test.tsx @@ -2,9 +2,9 @@ import { screen } from '@testing-library/react'; import { Mock } from 'ts-mockery'; import { useLocation } from 'react-router-dom'; import { TagsTable as createTagsTable } from '../../src/tags/TagsTable'; -import { SelectedServer } from '../../src/servers/data'; +import type { SelectedServer } from '../../src/servers/data'; import { rangeOf } from '../../src/utils/utils'; -import { NormalizedTag } from '../../src/tags/data'; +import type { NormalizedTag } from '../../src/tags/data'; import { renderWithEvents } from '../__helpers__/setUpTest'; jest.mock('react-router-dom', () => ({ ...jest.requireActual('react-router-dom'), useLocation: jest.fn() })); diff --git a/test/tags/TagsTableRow.test.tsx b/test/tags/TagsTableRow.test.tsx index 4974f621..94c39a81 100644 --- a/test/tags/TagsTableRow.test.tsx +++ b/test/tags/TagsTableRow.test.tsx @@ -2,7 +2,7 @@ import { screen } from '@testing-library/react'; import { Mock } from 'ts-mockery'; import { MemoryRouter } from 'react-router-dom'; import { TagsTableRow as createTagsTableRow } from '../../src/tags/TagsTableRow'; -import { ReachableServer } from '../../src/servers/data'; +import type { ReachableServer } from '../../src/servers/data'; import { renderWithEvents } from '../__helpers__/setUpTest'; import { colorGeneratorMock } from '../utils/services/__mocks__/ColorGenerator.mock'; diff --git a/test/tags/helpers/DeleteTagConfirmModal.test.tsx b/test/tags/helpers/DeleteTagConfirmModal.test.tsx index 00a7cdf1..55493087 100644 --- a/test/tags/helpers/DeleteTagConfirmModal.test.tsx +++ b/test/tags/helpers/DeleteTagConfirmModal.test.tsx @@ -1,6 +1,6 @@ import { screen } from '@testing-library/react'; import { DeleteTagConfirmModal } from '../../../src/tags/helpers/DeleteTagConfirmModal'; -import { TagDeletion } from '../../../src/tags/reducers/tagDelete'; +import type { TagDeletion } from '../../../src/tags/reducers/tagDelete'; import { renderWithEvents } from '../../__helpers__/setUpTest'; describe('', () => { diff --git a/test/tags/helpers/EditTagModal.test.tsx b/test/tags/helpers/EditTagModal.test.tsx index b4bc1dbf..3ffbcd54 100644 --- a/test/tags/helpers/EditTagModal.test.tsx +++ b/test/tags/helpers/EditTagModal.test.tsx @@ -1,10 +1,10 @@ import { screen, waitFor } from '@testing-library/react'; import { Mock } from 'ts-mockery'; -import { TagEdition } from '../../../src/tags/reducers/tagEdit'; +import type { TagEdition } from '../../../src/tags/reducers/tagEdit'; import { EditTagModal as createEditTagModal } from '../../../src/tags/helpers/EditTagModal'; -import { ColorGenerator } from '../../../src/utils/services/ColorGenerator'; +import type { ColorGenerator } from '../../../src/utils/services/ColorGenerator'; import { renderWithEvents } from '../../__helpers__/setUpTest'; -import { ProblemDetailsError } from '../../../src/api/types/errors'; +import type { ProblemDetailsError } from '../../../src/api/types/errors'; describe('', () => { const EditTagModal = createEditTagModal(Mock.of({ getColorForKey: jest.fn(() => 'green') })); diff --git a/test/tags/helpers/Tag.test.tsx b/test/tags/helpers/Tag.test.tsx index edd4d20c..c45b3003 100644 --- a/test/tags/helpers/Tag.test.tsx +++ b/test/tags/helpers/Tag.test.tsx @@ -1,7 +1,7 @@ import { screen } from '@testing-library/react'; import { Mock } from 'ts-mockery'; -import { ReactNode } from 'react'; -import { ColorGenerator } from '../../../src/utils/services/ColorGenerator'; +import type { ReactNode } from 'react'; +import type { ColorGenerator } from '../../../src/utils/services/ColorGenerator'; import { MAIN_COLOR } from '../../../src/utils/theme'; import { Tag } from '../../../src/tags/helpers/Tag'; import { renderWithEvents } from '../../__helpers__/setUpTest'; diff --git a/test/tags/helpers/TagsSelector.test.tsx b/test/tags/helpers/TagsSelector.test.tsx index e6bed7ec..2553e413 100644 --- a/test/tags/helpers/TagsSelector.test.tsx +++ b/test/tags/helpers/TagsSelector.test.tsx @@ -1,8 +1,8 @@ import { screen } from '@testing-library/react'; import { Mock } from 'ts-mockery'; import { TagsSelector as createTagsSelector } from '../../../src/tags/helpers/TagsSelector'; -import { TagsList } from '../../../src/tags/reducers/tagsList'; -import { Settings } from '../../../src/settings/reducers/settings'; +import type { TagsList } from '../../../src/tags/reducers/tagsList'; +import type { Settings } from '../../../src/settings/reducers/settings'; import { renderWithEvents } from '../../__helpers__/setUpTest'; import { colorGeneratorMock } from '../../utils/services/__mocks__/ColorGenerator.mock'; diff --git a/test/tags/reducers/tagDelete.test.ts b/test/tags/reducers/tagDelete.test.ts index 3b4bf655..8519a6b0 100644 --- a/test/tags/reducers/tagDelete.test.ts +++ b/test/tags/reducers/tagDelete.test.ts @@ -1,7 +1,7 @@ import { Mock } from 'ts-mockery'; import { tagDeleted, tagDeleteReducerCreator } from '../../../src/tags/reducers/tagDelete'; -import { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient'; -import { ShlinkState } from '../../../src/container/types'; +import type { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient'; +import type { ShlinkState } from '../../../src/container/types'; describe('tagDeleteReducer', () => { const deleteTagsCall = jest.fn(); diff --git a/test/tags/reducers/tagEdit.test.ts b/test/tags/reducers/tagEdit.test.ts index b421c579..93b9c3da 100644 --- a/test/tags/reducers/tagEdit.test.ts +++ b/test/tags/reducers/tagEdit.test.ts @@ -1,8 +1,9 @@ import { Mock } from 'ts-mockery'; -import { tagEdited, editTag as editTagCreator, EditTagAction, tagEditReducerCreator } from '../../../src/tags/reducers/tagEdit'; -import { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient'; -import { ColorGenerator } from '../../../src/utils/services/ColorGenerator'; -import { ShlinkState } from '../../../src/container/types'; +import type { EditTagAction } from '../../../src/tags/reducers/tagEdit'; +import { tagEdited, editTag as editTagCreator, tagEditReducerCreator } from '../../../src/tags/reducers/tagEdit'; +import type { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient'; +import type { ColorGenerator } from '../../../src/utils/services/ColorGenerator'; +import type { ShlinkState } from '../../../src/container/types'; describe('tagEditReducer', () => { const oldName = 'foo'; diff --git a/test/tags/reducers/tagsList.test.ts b/test/tags/reducers/tagsList.test.ts index 2bea89bf..d088c2e5 100644 --- a/test/tags/reducers/tagsList.test.ts +++ b/test/tags/reducers/tagsList.test.ts @@ -1,12 +1,13 @@ import { Mock } from 'ts-mockery'; +import type { + TagsList } from '../../../src/tags/reducers/tagsList'; import { - TagsList, filterTags, listTags as listTagsCreator, tagsListReducerCreator, } from '../../../src/tags/reducers/tagsList'; -import { ShlinkState } from '../../../src/container/types'; -import { ShortUrl } from '../../../src/short-urls/data'; +import type { ShlinkState } from '../../../src/container/types'; +import type { ShortUrl } from '../../../src/short-urls/data'; import { createShortUrl as createShortUrlCreator } from '../../../src/short-urls/reducers/shortUrlCreation'; import { tagEdited } from '../../../src/tags/reducers/tagEdit'; import { tagDeleted } from '../../../src/tags/reducers/tagDelete'; diff --git a/test/utils/DropdownBtn.test.tsx b/test/utils/DropdownBtn.test.tsx index 36d820a8..a3c6309e 100644 --- a/test/utils/DropdownBtn.test.tsx +++ b/test/utils/DropdownBtn.test.tsx @@ -1,6 +1,7 @@ import { screen } from '@testing-library/react'; -import { PropsWithChildren } from 'react'; -import { DropdownBtn, DropdownBtnProps } from '../../src/utils/DropdownBtn'; +import type { PropsWithChildren } from 'react'; +import type { DropdownBtnProps } from '../../src/utils/DropdownBtn'; +import { DropdownBtn } from '../../src/utils/DropdownBtn'; import { renderWithEvents } from '../__helpers__/setUpTest'; describe('', () => { diff --git a/test/utils/DropdownBtnMenu.test.tsx b/test/utils/DropdownBtnMenu.test.tsx index d7ef86b8..c38d0c7d 100644 --- a/test/utils/DropdownBtnMenu.test.tsx +++ b/test/utils/DropdownBtnMenu.test.tsx @@ -1,6 +1,7 @@ import { screen } from '@testing-library/react'; import { Mock } from 'ts-mockery'; -import { DropdownBtnMenu, DropdownBtnMenuProps } from '../../src/utils/DropdownBtnMenu'; +import type { DropdownBtnMenuProps } from '../../src/utils/DropdownBtnMenu'; +import { DropdownBtnMenu } from '../../src/utils/DropdownBtnMenu'; import { renderWithEvents } from '../__helpers__/setUpTest'; describe('', () => { diff --git a/test/utils/InfoTooltip.test.tsx b/test/utils/InfoTooltip.test.tsx index 1bda4e60..69d18203 100644 --- a/test/utils/InfoTooltip.test.tsx +++ b/test/utils/InfoTooltip.test.tsx @@ -1,6 +1,7 @@ import { screen, waitFor } from '@testing-library/react'; -import { Placement } from '@popperjs/core'; -import { InfoTooltip, InfoTooltipProps } from '../../src/utils/InfoTooltip'; +import type { Placement } from '@popperjs/core'; +import type { InfoTooltipProps } from '../../src/utils/InfoTooltip'; +import { InfoTooltip } from '../../src/utils/InfoTooltip'; import { renderWithEvents } from '../__helpers__/setUpTest'; describe('', () => { diff --git a/test/utils/Message.test.tsx b/test/utils/Message.test.tsx index d800a66d..7adbe691 100644 --- a/test/utils/Message.test.tsx +++ b/test/utils/Message.test.tsx @@ -1,6 +1,7 @@ import { render, screen } from '@testing-library/react'; -import { PropsWithChildren } from 'react'; -import { Message, MessageProps } from '../../src/utils/Message'; +import type { PropsWithChildren } from 'react'; +import type { MessageProps } from '../../src/utils/Message'; +import { Message } from '../../src/utils/Message'; describe('', () => { const setUp = (props: PropsWithChildren = {}) => render(); diff --git a/test/utils/OrderingDropdown.test.tsx b/test/utils/OrderingDropdown.test.tsx index f8e78944..1a35a31c 100644 --- a/test/utils/OrderingDropdown.test.tsx +++ b/test/utils/OrderingDropdown.test.tsx @@ -1,7 +1,8 @@ import { screen } from '@testing-library/react'; import { values } from 'ramda'; -import { OrderingDropdown, OrderingDropdownProps } from '../../src/utils/OrderingDropdown'; -import { OrderDir } from '../../src/utils/helpers/ordering'; +import type { OrderingDropdownProps } from '../../src/utils/OrderingDropdown'; +import { OrderingDropdown } from '../../src/utils/OrderingDropdown'; +import type { OrderDir } from '../../src/utils/helpers/ordering'; import { renderWithEvents } from '../__helpers__/setUpTest'; describe('', () => { diff --git a/test/utils/Result.test.tsx b/test/utils/Result.test.tsx index 0ba9b3f3..92a342a6 100644 --- a/test/utils/Result.test.tsx +++ b/test/utils/Result.test.tsx @@ -1,5 +1,6 @@ import { render, screen } from '@testing-library/react'; -import { Result, ResultProps, ResultType } from '../../src/utils/Result'; +import type { ResultProps, ResultType } from '../../src/utils/Result'; +import { Result } from '../../src/utils/Result'; describe('', () => { const setUp = (props: ResultProps) => render(); diff --git a/test/utils/dates/DateInput.test.tsx b/test/utils/dates/DateInput.test.tsx index 525b0652..e7389f50 100644 --- a/test/utils/dates/DateInput.test.tsx +++ b/test/utils/dates/DateInput.test.tsx @@ -1,7 +1,8 @@ import { screen, waitFor } from '@testing-library/react'; import { Mock } from 'ts-mockery'; import { parseISO } from 'date-fns'; -import { DateInput, DateInputProps } from '../../../src/utils/dates/DateInput'; +import type { DateInputProps } from '../../../src/utils/dates/DateInput'; +import { DateInput } from '../../../src/utils/dates/DateInput'; import { renderWithEvents } from '../../__helpers__/setUpTest'; describe('', () => { diff --git a/test/utils/dates/DateIntervalDropdownItems.test.tsx b/test/utils/dates/DateIntervalDropdownItems.test.tsx index 66a909aa..ac04b70d 100644 --- a/test/utils/dates/DateIntervalDropdownItems.test.tsx +++ b/test/utils/dates/DateIntervalDropdownItems.test.tsx @@ -1,6 +1,7 @@ import { screen, waitFor } from '@testing-library/react'; import { DateIntervalDropdownItems } from '../../../src/utils/dates/DateIntervalDropdownItems'; -import { DATE_INTERVALS, DateInterval, rangeOrIntervalToString } from '../../../src/utils/helpers/dateIntervals'; +import type { DateInterval } from '../../../src/utils/helpers/dateIntervals'; +import { DATE_INTERVALS, rangeOrIntervalToString } from '../../../src/utils/helpers/dateIntervals'; import { DropdownBtn } from '../../../src/utils/DropdownBtn'; import { renderWithEvents } from '../../__helpers__/setUpTest'; diff --git a/test/utils/dates/DateIntervalSelector.test.tsx b/test/utils/dates/DateIntervalSelector.test.tsx index 975159c7..3c56b9ce 100644 --- a/test/utils/dates/DateIntervalSelector.test.tsx +++ b/test/utils/dates/DateIntervalSelector.test.tsx @@ -1,5 +1,6 @@ import { screen, waitFor } from '@testing-library/react'; -import { DateInterval, rangeOrIntervalToString } from '../../../src/utils/helpers/dateIntervals'; +import type { DateInterval } from '../../../src/utils/helpers/dateIntervals'; +import { rangeOrIntervalToString } from '../../../src/utils/helpers/dateIntervals'; import { DateIntervalSelector } from '../../../src/utils/dates/DateIntervalSelector'; import { renderWithEvents } from '../../__helpers__/setUpTest'; diff --git a/test/utils/dates/DateRangeSelector.test.tsx b/test/utils/dates/DateRangeSelector.test.tsx index 858d06c0..ed4429fa 100644 --- a/test/utils/dates/DateRangeSelector.test.tsx +++ b/test/utils/dates/DateRangeSelector.test.tsx @@ -1,7 +1,8 @@ import { screen, waitFor } from '@testing-library/react'; import { Mock } from 'ts-mockery'; -import { DateRangeSelector, DateRangeSelectorProps } from '../../../src/utils/dates/DateRangeSelector'; -import { DateInterval } from '../../../src/utils/helpers/dateIntervals'; +import type { DateRangeSelectorProps } from '../../../src/utils/dates/DateRangeSelector'; +import { DateRangeSelector } from '../../../src/utils/dates/DateRangeSelector'; +import type { DateInterval } from '../../../src/utils/helpers/dateIntervals'; import { renderWithEvents } from '../../__helpers__/setUpTest'; describe('', () => { diff --git a/test/utils/dates/Time.test.tsx b/test/utils/dates/Time.test.tsx index 38b38a47..aa57cdd8 100644 --- a/test/utils/dates/Time.test.tsx +++ b/test/utils/dates/Time.test.tsx @@ -1,5 +1,6 @@ import { render } from '@testing-library/react'; -import { TimeProps, Time } from '../../../src/utils/dates/Time'; +import type { TimeProps } from '../../../src/utils/dates/Time'; +import { Time } from '../../../src/utils/dates/Time'; import { parseDate } from '../../../src/utils/helpers/date'; describe('