From 504a44d135b54bd9dca3908c610479ce7bc56b0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Mierzwa?= Date: Tue, 25 May 2021 12:36:31 +0100 Subject: [PATCH] fix(ci): enable more checks in tsconfig --- ui/src/App.test.tsx | 2 +- ui/src/App.tsx | 2 +- ui/src/AppBoot.ts | 2 +- ui/src/Components/AlertAck/index.test.tsx | 2 +- ui/src/Components/AlertAck/index.tsx | 7 +++++-- ui/src/Components/AlertHistory/index.test.tsx | 2 +- ui/src/Components/AlertHistory/index.tsx | 2 +- ui/src/Components/FaviconBadge/index.tsx | 2 +- ui/src/Components/FetchPauser/index.tsx | 2 +- ui/src/Components/Fetcher/index.tsx | 2 +- .../Grid/AlertGrid/AlertGroup/Alert/AlertMenu.test.tsx | 2 +- .../Grid/AlertGrid/AlertGroup/Alert/AlertMenu.tsx | 8 ++++++-- .../Grid/AlertGrid/AlertGroup/Alert/index.test.tsx | 2 +- .../Grid/AlertGrid/AlertGroup/Alert/index.tsx | 8 ++++---- .../Grid/AlertGrid/AlertGroup/DetailsToggle.ts | 2 +- .../AlertGrid/AlertGroup/GroupFooter/index.test.tsx | 2 +- .../Grid/AlertGrid/AlertGroup/GroupFooter/index.tsx | 8 ++++---- .../AlertGroup/GroupHeader/GroupMenu.test.tsx | 5 ++++- .../AlertGrid/AlertGroup/GroupHeader/GroupMenu.tsx | 4 ++-- .../Grid/AlertGrid/AlertGroup/GroupHeader/index.tsx | 8 ++++---- .../Components/Grid/AlertGrid/AlertGroup/MenuLink.tsx | 4 ++-- .../Components/Grid/AlertGrid/AlertGroup/Silences.tsx | 6 +++--- .../Grid/AlertGrid/AlertGroup/index.test.tsx | 2 +- ui/src/Components/Grid/AlertGrid/AlertGroup/index.tsx | 10 +++++----- ui/src/Components/Grid/AlertGrid/Grid.tsx | 10 +++++----- .../Components/Grid/AlertGrid/GridLabelSelect.test.tsx | 2 +- ui/src/Components/Grid/AlertGrid/GridLabelSelect.tsx | 6 +++--- ui/src/Components/Grid/AlertGrid/GridSize.ts | 2 +- ui/src/Components/Grid/AlertGrid/Swimlane.tsx | 8 ++++---- ui/src/Components/Grid/AlertGrid/index.tsx | 8 ++++---- ui/src/Components/Grid/EmptyGrid/index.tsx | 2 +- ui/src/Components/Grid/FatalError/index.tsx | 2 +- ui/src/Components/Grid/index.tsx | 8 ++++---- .../InhibitedByModal/InhibitedByModalContent.tsx | 4 ++-- ui/src/Components/InhibitedByModal/index.tsx | 2 +- ui/src/Components/LabelSetList/index.test.tsx | 2 +- ui/src/Components/LabelSetList/index.tsx | 4 ++-- ui/src/Components/Labels/FilterInputLabel/index.tsx | 4 ++-- .../Components/Labels/FilteringCounterBadge/index.tsx | 2 +- ui/src/Components/Labels/FilteringLabel/index.tsx | 2 +- ui/src/Components/Labels/HistoryLabel/index.tsx | 4 ++-- ui/src/Components/Labels/LabelWithPercent/index.tsx | 2 +- ui/src/Components/Labels/StaticLabel/index.tsx | 4 ++-- ui/src/Components/Labels/Utils.ts | 4 ++-- .../Configuration/AlertGroupCollapseConfiguration.tsx | 4 ++-- .../Configuration/AlertGroupConfiguration.tsx | 2 +- .../Configuration/AlertGroupSortConfiguration.tsx | 4 ++-- .../Configuration/AlertGroupTitleBarColor.tsx | 4 ++-- .../Configuration/AlertGroupWidthConfiguration.tsx | 2 +- .../Configuration/AnimationsConfiguration.tsx | 4 ++-- .../MainModal/Configuration/FetchConfiguration.tsx | 2 +- .../MainModal/Configuration/FilterBarConfiguration.tsx | 4 ++-- .../MainModal/Configuration/GridLabelName.tsx | 2 +- .../MainModal/Configuration/MultiGridConfiguration.tsx | 4 ++-- .../MainModal/Configuration/SortLabelName.tsx | 4 ++-- .../MainModal/Configuration/ThemeConfiguration.tsx | 4 ++-- ui/src/Components/MainModal/Configuration/index.tsx | 4 ++-- ui/src/Components/MainModal/Help.tsx | 2 +- ui/src/Components/MainModal/MainModalContent.tsx | 4 ++-- ui/src/Components/MainModal/index.tsx | 4 ++-- .../Components/ManagedSilence/DeleteSilence.test.tsx | 2 +- ui/src/Components/ManagedSilence/DeleteSilence.tsx | 6 +++--- .../Components/ManagedSilence/SilenceComment.test.tsx | 2 +- ui/src/Components/ManagedSilence/SilenceComment.tsx | 6 +++--- .../Components/ManagedSilence/SilenceDetails.test.tsx | 2 +- ui/src/Components/ManagedSilence/SilenceDetails.tsx | 4 ++-- .../Components/ManagedSilence/SilenceProgress.test.tsx | 2 +- ui/src/Components/ManagedSilence/SilenceProgress.tsx | 2 +- ui/src/Components/ManagedSilence/index.test.tsx | 2 +- ui/src/Components/ManagedSilence/index.tsx | 6 +++--- ui/src/Components/Modal/Tab.tsx | 2 +- ui/src/Components/NavBar/FilterInput/History.tsx | 6 +++--- ui/src/Components/NavBar/FilterInput/index.tsx | 2 +- ui/src/Components/NavBar/index.tsx | 6 +++--- .../Components/OverviewModal/OverviewModalContent.tsx | 4 ++-- ui/src/Components/OverviewModal/index.stories.tsx | 2 +- ui/src/Components/OverviewModal/index.tsx | 2 +- ui/src/Components/PaginatedAlertList/index.tsx | 4 ++-- ui/src/Components/Select/index.tsx | 4 ++-- .../SilenceModal/AlertManagerInput/index.test.tsx | 2 +- .../SilenceModal/AlertManagerInput/index.tsx | 4 ++-- ui/src/Components/SilenceModal/AuthorInput.tsx | 6 +++--- ui/src/Components/SilenceModal/Browser/index.test.tsx | 2 +- ui/src/Components/SilenceModal/Browser/index.tsx | 6 +++--- .../SilenceModal/DateTimeSelect/HourMinute.tsx | 2 +- .../Components/SilenceModal/DateTimeSelect/index.tsx | 2 +- ui/src/Components/SilenceModal/Matchers.ts | 2 +- .../Components/SilenceModal/PayloadPreview/index.tsx | 4 ++-- ui/src/Components/SilenceModal/SilenceForm.test.tsx | 2 +- ui/src/Components/SilenceModal/SilenceForm.tsx | 4 ++-- .../SilenceModal/SilenceMatch/LabelNameInput.tsx | 2 +- .../SilenceModal/SilenceMatch/LabelValueInput.tsx | 2 +- .../SilenceModal/SilenceMatch/MatchCounter.tsx | 6 +++--- ui/src/Components/SilenceModal/SilenceMatch/index.tsx | 2 +- .../SilenceModal/SilenceModalContent.test.tsx | 2 +- ui/src/Components/SilenceModal/SilenceModalContent.tsx | 8 ++++---- .../Components/SilenceModal/SilencePreview/index.tsx | 6 +++--- .../SilenceModal/SilenceSubmit/MultiClusterStatus.tsx | 6 +++--- .../SilenceSubmit/SilenceSubmitController.tsx | 6 +++--- .../SilenceSubmit/SilenceSubmitProgress.test.tsx | 2 +- .../SilenceSubmit/SilenceSubmitProgress.tsx | 6 +++--- .../SilenceModal/SilenceSubmit/SingleClusterStatus.tsx | 6 +++--- ui/src/Components/SilenceModal/index.stories.tsx | 2 +- ui/src/Components/SilenceModal/index.tsx | 6 +++--- ui/src/Components/Theme/ReactSelect.ts | 4 ++-- ui/src/Components/Theme/index.tsx | 2 +- ui/src/Components/Toast/AppToasts.tsx | 2 +- ui/src/Components/Toast/ToastMessages.tsx | 2 +- ui/src/Components/Toast/index.tsx | 2 +- ui/src/Components/ToggleIcon/index.tsx | 2 +- ui/src/Components/ValidationError/index.tsx | 2 +- ui/src/Hooks/useFlashTransition.ts | 2 +- ui/src/Hooks/useGrid.test.tsx | 2 +- ui/src/Stores/AlertStore.ts | 2 +- ui/src/Stores/Settings.ts | 4 ++-- ui/src/Stores/SilenceFormStore.ts | 6 +++--- ui/src/Styles/DarkTheme.tsx | 2 +- ui/src/Styles/LightTheme.tsx | 2 +- ui/src/__fixtures__/AlertHistory.ts | 2 +- ui/src/__fixtures__/Alerts.ts | 2 +- ui/src/__fixtures__/Defaults.ts | 2 +- ui/src/__fixtures__/Fetch.ts | 2 +- ui/src/__fixtures__/Stories.ts | 4 ++-- ui/src/__fixtures__/useFetchGet.ts | 4 ++-- ui/tsconfig.json | 7 ++++--- 125 files changed, 233 insertions(+), 222 deletions(-) diff --git a/ui/src/App.test.tsx b/ui/src/App.test.tsx index a6d1939fc..52497d4f4 100644 --- a/ui/src/App.test.tsx +++ b/ui/src/App.test.tsx @@ -1,7 +1,7 @@ import { mount } from "enzyme"; import { mockMatchMedia } from "__fixtures__/matchMedia"; -import { UIDefaults, ThemeT } from "Models/UI"; +import type { UIDefaults, ThemeT } from "Models/UI"; import { SilenceFormStore, NewEmptyMatcher } from "Stores/SilenceFormStore"; import { StringToOption } from "Common/Select"; import { App } from "./App"; diff --git a/ui/src/App.tsx b/ui/src/App.tsx index 173abaafd..cc656c55a 100644 --- a/ui/src/App.tsx +++ b/ui/src/App.tsx @@ -13,7 +13,7 @@ import { ReactSelectStyles, } from "Components/Theme/ReactSelect"; import { BodyTheme, ThemeContext } from "Components/Theme"; -import { UIDefaults } from "Models/UI"; +import type { UIDefaults } from "Models/UI"; import { ErrorBoundary } from "./ErrorBoundary"; import "Styles/ResetCSS.scss"; diff --git a/ui/src/AppBoot.ts b/ui/src/AppBoot.ts index e662afa2c..88cba0fe2 100644 --- a/ui/src/AppBoot.ts +++ b/ui/src/AppBoot.ts @@ -2,7 +2,7 @@ import { init } from "@sentry/browser"; -import { UIDefaults } from "Models/UI"; +import type { UIDefaults } from "Models/UI"; const SettingsElement = (): HTMLElement | null => document.getElementById("settings"); diff --git a/ui/src/Components/AlertAck/index.test.tsx b/ui/src/Components/AlertAck/index.test.tsx index b316f104e..561ae4eec 100644 --- a/ui/src/Components/AlertAck/index.test.tsx +++ b/ui/src/Components/AlertAck/index.test.tsx @@ -9,7 +9,7 @@ import { advanceTo, clear } from "jest-date-mock"; import fetchMock from "fetch-mock"; import { MockAlertGroup, MockAlert } from "__fixtures__/Alerts"; -import { APIAlertT, APIAlertGroupT } from "Models/APITypes"; +import type { APIAlertT, APIAlertGroupT } from "Models/APITypes"; import { AlertStore } from "Stores/AlertStore"; import { SilenceFormStore } from "Stores/SilenceFormStore"; import { AlertAck } from "."; diff --git a/ui/src/Components/AlertAck/index.tsx b/ui/src/Components/AlertAck/index.tsx index a49fc4b7b..9f0af7da5 100644 --- a/ui/src/Components/AlertAck/index.tsx +++ b/ui/src/Components/AlertAck/index.tsx @@ -11,8 +11,11 @@ import { faCheckCircle } from "@fortawesome/free-solid-svg-icons/faCheckCircle"; import { faSpinner } from "@fortawesome/free-solid-svg-icons/faSpinner"; import { faExclamationCircle } from "@fortawesome/free-solid-svg-icons/faExclamationCircle"; -import { APIAlertGroupT, AlertmanagerSilencePayloadT } from "Models/APITypes"; -import { AlertStore } from "Stores/AlertStore"; +import type { + APIAlertGroupT, + AlertmanagerSilencePayloadT, +} from "Models/APITypes"; +import type { AlertStore } from "Stores/AlertStore"; import { SilenceFormStore, MatchersFromGroup, diff --git a/ui/src/Components/AlertHistory/index.test.tsx b/ui/src/Components/AlertHistory/index.test.tsx index 4080708b6..ef6a3e4b3 100644 --- a/ui/src/Components/AlertHistory/index.test.tsx +++ b/ui/src/Components/AlertHistory/index.test.tsx @@ -14,7 +14,7 @@ import { RainbowHistoryResponse, FailedHistoryResponse, } from "__fixtures__/AlertHistory"; -import { APIAlertGroupT, HistoryResponseT } from "Models/APITypes"; +import type { APIAlertGroupT, HistoryResponseT } from "Models/APITypes"; import { AlertHistory } from "."; let group: APIAlertGroupT; diff --git a/ui/src/Components/AlertHistory/index.tsx b/ui/src/Components/AlertHistory/index.tsx index d0bd8a4e4..2b9270bf3 100644 --- a/ui/src/Components/AlertHistory/index.tsx +++ b/ui/src/Components/AlertHistory/index.tsx @@ -3,7 +3,7 @@ import { FC, useEffect, useState } from "react"; import { useInView } from "react-intersection-observer"; import { FormatBackendURI } from "Stores/AlertStore"; -import { APIAlertGroupT, HistoryResponseT } from "Models/APITypes"; +import type { APIAlertGroupT, HistoryResponseT } from "Models/APITypes"; import { useFetchAny, UpstreamT } from "Hooks/useFetchAny"; import { TooltipWrapper } from "Components/TooltipWrapper"; diff --git a/ui/src/Components/FaviconBadge/index.tsx b/ui/src/Components/FaviconBadge/index.tsx index 7fcc5b16b..fe80d9633 100644 --- a/ui/src/Components/FaviconBadge/index.tsx +++ b/ui/src/Components/FaviconBadge/index.tsx @@ -4,7 +4,7 @@ import { autorun } from "mobx"; import Favico from "favico.js"; -import { AlertStore } from "Stores/AlertStore"; +import type { AlertStore } from "Stores/AlertStore"; const FaviconBadge: FC<{ alertStore: AlertStore; diff --git a/ui/src/Components/FetchPauser/index.tsx b/ui/src/Components/FetchPauser/index.tsx index 8955fb54a..6b3ed25f7 100644 --- a/ui/src/Components/FetchPauser/index.tsx +++ b/ui/src/Components/FetchPauser/index.tsx @@ -1,6 +1,6 @@ import { FC, ReactElement, useEffect } from "react"; -import { AlertStore } from "Stores/AlertStore"; +import type { AlertStore } from "Stores/AlertStore"; const FetchPauser: FC<{ children: ReactElement; diff --git a/ui/src/Components/Fetcher/index.tsx b/ui/src/Components/Fetcher/index.tsx index 90f7845d0..48ca4daa6 100644 --- a/ui/src/Components/Fetcher/index.tsx +++ b/ui/src/Components/Fetcher/index.tsx @@ -13,7 +13,7 @@ import { faPause } from "@fortawesome/free-solid-svg-icons/faPause"; import { faPlay } from "@fortawesome/free-solid-svg-icons/faPlay"; import { AlertStore, AlertStoreStatuses } from "Stores/AlertStore"; -import { Settings } from "Stores/Settings"; +import type { Settings } from "Stores/Settings"; import { ThemeContext } from "Components/Theme"; import { TooltipWrapper } from "Components/TooltipWrapper"; diff --git a/ui/src/Components/Grid/AlertGrid/AlertGroup/Alert/AlertMenu.test.tsx b/ui/src/Components/Grid/AlertGrid/AlertGroup/Alert/AlertMenu.test.tsx index e708f0af9..f1d874e41 100644 --- a/ui/src/Components/Grid/AlertGrid/AlertGroup/Alert/AlertMenu.test.tsx +++ b/ui/src/Components/Grid/AlertGrid/AlertGroup/Alert/AlertMenu.test.tsx @@ -3,7 +3,7 @@ import { act } from "react-dom/test-utils"; import { mount } from "enzyme"; import { MockAlertGroup, MockAlert } from "__fixtures__/Alerts"; -import { +import type { APIAlertGroupT, APIAlertT, APIAlertsResponseUpstreamsT, diff --git a/ui/src/Components/Grid/AlertGrid/AlertGroup/Alert/AlertMenu.tsx b/ui/src/Components/Grid/AlertGrid/AlertGroup/Alert/AlertMenu.tsx index ac2427064..03410ee08 100644 --- a/ui/src/Components/Grid/AlertGrid/AlertGroup/Alert/AlertMenu.tsx +++ b/ui/src/Components/Grid/AlertGrid/AlertGroup/Alert/AlertMenu.tsx @@ -10,8 +10,12 @@ import { faBellSlash } from "@fortawesome/free-solid-svg-icons/faBellSlash"; import { faExternalLinkAlt } from "@fortawesome/free-solid-svg-icons/faExternalLinkAlt"; import { faWrench } from "@fortawesome/free-solid-svg-icons/faWrench"; -import { APIAlertT, APIAlertGroupT, APIAnnotationT } from "Models/APITypes"; -import { AlertStore } from "Stores/AlertStore"; +import type { + APIAlertT, + APIAlertGroupT, + APIAnnotationT, +} from "Models/APITypes"; +import type { AlertStore } from "Stores/AlertStore"; import { SilenceFormStore, AlertmanagerClustersToOption, diff --git a/ui/src/Components/Grid/AlertGrid/AlertGroup/Alert/index.test.tsx b/ui/src/Components/Grid/AlertGrid/AlertGroup/Alert/index.test.tsx index de3a49055..e5d04ebd8 100644 --- a/ui/src/Components/Grid/AlertGrid/AlertGroup/Alert/index.test.tsx +++ b/ui/src/Components/Grid/AlertGrid/AlertGroup/Alert/index.test.tsx @@ -13,7 +13,7 @@ import { MockSilence, } from "__fixtures__/Alerts"; import { MockThemeContext } from "__fixtures__/Theme"; -import { APIAlertGroupT, APIAlertT } from "Models/APITypes"; +import type { APIAlertGroupT, APIAlertT } from "Models/APITypes"; import { AlertStore } from "Stores/AlertStore"; import { SilenceFormStore } from "Stores/SilenceFormStore"; import { BorderClassMap } from "Common/Colors"; diff --git a/ui/src/Components/Grid/AlertGrid/AlertGroup/Alert/index.tsx b/ui/src/Components/Grid/AlertGrid/AlertGroup/Alert/index.tsx index 728d93a72..36582ceb4 100644 --- a/ui/src/Components/Grid/AlertGrid/AlertGroup/Alert/index.tsx +++ b/ui/src/Components/Grid/AlertGrid/AlertGroup/Alert/index.tsx @@ -1,14 +1,14 @@ -import { FC } from "react"; +import type { FC } from "react"; import { observer } from "mobx-react-lite"; -import { +import type { APIAlertT, APIAlertGroupT, APIAlertmanagerStateT, } from "Models/APITypes"; -import { AlertStore } from "Stores/AlertStore"; -import { SilenceFormStore } from "Stores/SilenceFormStore"; +import type { AlertStore } from "Stores/AlertStore"; +import type { SilenceFormStore } from "Stores/SilenceFormStore"; import { BorderClassMap } from "Common/Colors"; import { StaticLabels } from "Common/Query"; import FilteringLabel from "Components/Labels/FilteringLabel"; diff --git a/ui/src/Components/Grid/AlertGrid/AlertGroup/DetailsToggle.ts b/ui/src/Components/Grid/AlertGrid/AlertGroup/DetailsToggle.ts index d4a80ff72..b1f9cce1b 100644 --- a/ui/src/Components/Grid/AlertGrid/AlertGroup/DetailsToggle.ts +++ b/ui/src/Components/Grid/AlertGrid/AlertGroup/DetailsToggle.ts @@ -1,5 +1,5 @@ import { IsMobile } from "Common/Device"; -import { Settings } from "Stores/Settings"; +import type { Settings } from "Stores/Settings"; const DefaultDetailsCollapseValue = (settingsStore: Settings): boolean => { let defaultCollapseState; diff --git a/ui/src/Components/Grid/AlertGrid/AlertGroup/GroupFooter/index.test.tsx b/ui/src/Components/Grid/AlertGrid/AlertGroup/GroupFooter/index.test.tsx index 915b76201..f42f2ce41 100644 --- a/ui/src/Components/Grid/AlertGrid/AlertGroup/GroupFooter/index.test.tsx +++ b/ui/src/Components/Grid/AlertGrid/AlertGroup/GroupFooter/index.test.tsx @@ -11,7 +11,7 @@ import { MockSilence, } from "__fixtures__/Alerts"; import { MockThemeContext } from "__fixtures__/Theme"; -import { APIAlertGroupT } from "Models/APITypes"; +import type { APIAlertGroupT } from "Models/APITypes"; import { AlertStore } from "Stores/AlertStore"; import { SilenceFormStore } from "Stores/SilenceFormStore"; import { ThemeContext } from "Components/Theme"; diff --git a/ui/src/Components/Grid/AlertGrid/AlertGroup/GroupFooter/index.tsx b/ui/src/Components/Grid/AlertGrid/AlertGroup/GroupFooter/index.tsx index b858ea967..507da3e30 100644 --- a/ui/src/Components/Grid/AlertGrid/AlertGroup/GroupFooter/index.tsx +++ b/ui/src/Components/Grid/AlertGrid/AlertGroup/GroupFooter/index.tsx @@ -1,11 +1,11 @@ -import { FC } from "react"; +import type { FC } from "react"; import { observer } from "mobx-react-lite"; -import { APIAlertGroupT } from "Models/APITypes"; +import type { APIAlertGroupT } from "Models/APITypes"; import { StaticLabels } from "Common/Query"; -import { AlertStore } from "Stores/AlertStore"; -import { SilenceFormStore } from "Stores/SilenceFormStore"; +import type { AlertStore } from "Stores/AlertStore"; +import type { SilenceFormStore } from "Stores/SilenceFormStore"; import FilteringLabel from "Components/Labels/FilteringLabel"; import { RenderNonLinkAnnotation, RenderLinkAnnotation } from "../Annotation"; import { RenderSilence } from "../Silences"; diff --git a/ui/src/Components/Grid/AlertGrid/AlertGroup/GroupHeader/GroupMenu.test.tsx b/ui/src/Components/Grid/AlertGrid/AlertGroup/GroupHeader/GroupMenu.test.tsx index ff650cd27..87a8fac93 100644 --- a/ui/src/Components/Grid/AlertGrid/AlertGroup/GroupHeader/GroupMenu.test.tsx +++ b/ui/src/Components/Grid/AlertGrid/AlertGroup/GroupHeader/GroupMenu.test.tsx @@ -5,7 +5,10 @@ import { mount } from "enzyme"; import copy from "copy-to-clipboard"; import { MockAlertGroup } from "__fixtures__/Alerts"; -import { APIAlertGroupT, APIAlertsResponseUpstreamsT } from "Models/APITypes"; +import type { + APIAlertGroupT, + APIAlertsResponseUpstreamsT, +} from "Models/APITypes"; import { AlertStore } from "Stores/AlertStore"; import { SilenceFormStore } from "Stores/SilenceFormStore"; import { GroupMenu, MenuContent } from "./GroupMenu"; diff --git a/ui/src/Components/Grid/AlertGrid/AlertGroup/GroupHeader/GroupMenu.tsx b/ui/src/Components/Grid/AlertGrid/AlertGroup/GroupHeader/GroupMenu.tsx index 3a1b69638..168ac79af 100644 --- a/ui/src/Components/Grid/AlertGrid/AlertGroup/GroupHeader/GroupMenu.tsx +++ b/ui/src/Components/Grid/AlertGrid/AlertGroup/GroupHeader/GroupMenu.tsx @@ -10,9 +10,9 @@ import { faShareSquare } from "@fortawesome/free-solid-svg-icons/faShareSquare"; import { faBellSlash } from "@fortawesome/free-solid-svg-icons/faBellSlash"; import { faWrench } from "@fortawesome/free-solid-svg-icons/faWrench"; -import { APIAlertGroupT } from "Models/APITypes"; +import type { APIAlertGroupT } from "Models/APITypes"; import { FormatAlertsQ } from "Stores/AlertStore"; -import { AlertStore } from "Stores/AlertStore"; +import type { AlertStore } from "Stores/AlertStore"; import { SilenceFormStore, AlertmanagerClustersToOption, diff --git a/ui/src/Components/Grid/AlertGrid/AlertGroup/GroupHeader/index.tsx b/ui/src/Components/Grid/AlertGrid/AlertGroup/GroupHeader/index.tsx index 20bef1780..ae0d3b703 100644 --- a/ui/src/Components/Grid/AlertGrid/AlertGroup/GroupHeader/index.tsx +++ b/ui/src/Components/Grid/AlertGrid/AlertGroup/GroupHeader/index.tsx @@ -1,10 +1,10 @@ -import { FC, MouseEvent } from "react"; +import type { FC, MouseEvent } from "react"; import { observer } from "mobx-react-lite"; -import { APIAlertGroupT } from "Models/APITypes"; -import { AlertStore } from "Stores/AlertStore"; -import { SilenceFormStore } from "Stores/SilenceFormStore"; +import type { APIAlertGroupT } from "Models/APITypes"; +import type { AlertStore } from "Stores/AlertStore"; +import type { SilenceFormStore } from "Stores/SilenceFormStore"; import FilteringLabel from "Components/Labels/FilteringLabel"; import FilteringCounterBadge from "Components/Labels/FilteringCounterBadge"; import { TooltipWrapper } from "Components/TooltipWrapper"; diff --git a/ui/src/Components/Grid/AlertGrid/AlertGroup/MenuLink.tsx b/ui/src/Components/Grid/AlertGrid/AlertGroup/MenuLink.tsx index ff8d5ce43..6250e34cf 100644 --- a/ui/src/Components/Grid/AlertGrid/AlertGroup/MenuLink.tsx +++ b/ui/src/Components/Grid/AlertGrid/AlertGroup/MenuLink.tsx @@ -1,6 +1,6 @@ -import { FC } from "react"; +import type { FC } from "react"; -import { IconDefinition } from "@fortawesome/fontawesome-svg-core"; +import type { IconDefinition } from "@fortawesome/fontawesome-svg-core"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; const MenuLink: FC<{ diff --git a/ui/src/Components/Grid/AlertGrid/AlertGroup/Silences.tsx b/ui/src/Components/Grid/AlertGrid/AlertGroup/Silences.tsx index db484d68b..c413a1116 100644 --- a/ui/src/Components/Grid/AlertGrid/AlertGroup/Silences.tsx +++ b/ui/src/Components/Grid/AlertGrid/AlertGroup/Silences.tsx @@ -1,8 +1,8 @@ import { FC, memo } from "react"; -import { APISilenceT } from "Models/APITypes"; -import { AlertStore } from "Stores/AlertStore"; -import { SilenceFormStore } from "Stores/SilenceFormStore"; +import type { APISilenceT } from "Models/APITypes"; +import type { AlertStore } from "Stores/AlertStore"; +import type { SilenceFormStore } from "Stores/SilenceFormStore"; import { ManagedSilence } from "Components/ManagedSilence"; const FallbackSilenceDesciption: FC<{ diff --git a/ui/src/Components/Grid/AlertGrid/AlertGroup/index.test.tsx b/ui/src/Components/Grid/AlertGrid/AlertGroup/index.test.tsx index 9e18adc05..b75452d1c 100644 --- a/ui/src/Components/Grid/AlertGrid/AlertGroup/index.test.tsx +++ b/ui/src/Components/Grid/AlertGrid/AlertGroup/index.test.tsx @@ -7,7 +7,7 @@ import { MockThemeContext, MockThemeContextWithoutAnimations, } from "__fixtures__/Theme"; -import { APIAlertGroupT } from "Models/APITypes"; +import type { APIAlertGroupT } from "Models/APITypes"; import { AlertStore } from "Stores/AlertStore"; import { Settings, CollapseStateT } from "Stores/Settings"; import { SilenceFormStore } from "Stores/SilenceFormStore"; diff --git a/ui/src/Components/Grid/AlertGrid/AlertGroup/index.tsx b/ui/src/Components/Grid/AlertGrid/AlertGroup/index.tsx index fd3baf08a..33fb1649f 100644 --- a/ui/src/Components/Grid/AlertGrid/AlertGroup/index.tsx +++ b/ui/src/Components/Grid/AlertGrid/AlertGroup/index.tsx @@ -2,16 +2,16 @@ import React, { FC, useEffect, useCallback, useState, ReactNode } from "react"; import { observer } from "mobx-react-lite"; -import { IconDefinition } from "@fortawesome/fontawesome-svg-core"; +import type { IconDefinition } from "@fortawesome/fontawesome-svg-core"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faPlus } from "@fortawesome/free-solid-svg-icons/faPlus"; import { faMinus } from "@fortawesome/free-solid-svg-icons/faMinus"; import { faEllipsisH } from "@fortawesome/free-solid-svg-icons/faEllipsisH"; -import { APIAlertT, APIAlertGroupT, AlertStateT } from "Models/APITypes"; -import { Settings } from "Stores/Settings"; -import { AlertStore } from "Stores/AlertStore"; -import { SilenceFormStore } from "Stores/SilenceFormStore"; +import type { APIAlertT, APIAlertGroupT, AlertStateT } from "Models/APITypes"; +import type { Settings } from "Stores/Settings"; +import type { AlertStore } from "Stores/AlertStore"; +import type { SilenceFormStore } from "Stores/SilenceFormStore"; import { BackgroundClassMap } from "Common/Colors"; import { TooltipWrapper } from "Components/TooltipWrapper"; import { ThemeContext } from "Components/Theme"; diff --git a/ui/src/Components/Grid/AlertGrid/Grid.tsx b/ui/src/Components/Grid/AlertGrid/Grid.tsx index 18b3f72aa..f58658c13 100644 --- a/ui/src/Components/Grid/AlertGrid/Grid.tsx +++ b/ui/src/Components/Grid/AlertGrid/Grid.tsx @@ -11,7 +11,7 @@ import { observer } from "mobx-react-lite"; import debounce from "lodash.debounce"; -import { SizeDetail } from "bricks.js"; +import type { SizeDetail } from "bricks.js"; import TransitionGroup from "react-transition-group/TransitionGroup"; import { CSSTransition } from "react-transition-group"; @@ -21,10 +21,10 @@ import FontFaceObserver from "fontfaceobserver"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faAngleDoubleDown } from "@fortawesome/free-solid-svg-icons/faAngleDoubleDown"; -import { AlertStore } from "Stores/AlertStore"; -import { Settings } from "Stores/Settings"; -import { SilenceFormStore } from "Stores/SilenceFormStore"; -import { APIGridT } from "Models/APITypes"; +import type { AlertStore } from "Stores/AlertStore"; +import type { Settings } from "Stores/Settings"; +import type { SilenceFormStore } from "Stores/SilenceFormStore"; +import type { APIGridT } from "Models/APITypes"; import { useGrid } from "Hooks/useGrid"; import { ThemeContext } from "Components/Theme"; import { DefaultDetailsCollapseValue } from "./AlertGroup/DetailsToggle"; diff --git a/ui/src/Components/Grid/AlertGrid/GridLabelSelect.test.tsx b/ui/src/Components/Grid/AlertGrid/GridLabelSelect.test.tsx index 08266c39f..b3888bded 100644 --- a/ui/src/Components/Grid/AlertGrid/GridLabelSelect.test.tsx +++ b/ui/src/Components/Grid/AlertGrid/GridLabelSelect.test.tsx @@ -7,7 +7,7 @@ import fetchMock from "fetch-mock"; import { MockGrid } from "__fixtures__/Stories"; import { AlertStore } from "Stores/AlertStore"; import { Settings } from "Stores/Settings"; -import { APIGridT } from "Models/APITypes"; +import type { APIGridT } from "Models/APITypes"; import { GridLabelSelect } from "./GridLabelSelect"; let alertStore: AlertStore; diff --git a/ui/src/Components/Grid/AlertGrid/GridLabelSelect.tsx b/ui/src/Components/Grid/AlertGrid/GridLabelSelect.tsx index de89e15d1..54fd4a0ee 100644 --- a/ui/src/Components/Grid/AlertGrid/GridLabelSelect.tsx +++ b/ui/src/Components/Grid/AlertGrid/GridLabelSelect.tsx @@ -16,9 +16,9 @@ import AsyncSelect from "react-select/async"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faCaretDown } from "@fortawesome/free-solid-svg-icons/faCaretDown"; -import { AlertStore } from "Stores/AlertStore"; -import { Settings } from "Stores/Settings"; -import { APIGridT } from "Models/APITypes"; +import type { AlertStore } from "Stores/AlertStore"; +import type { Settings } from "Stores/Settings"; +import type { APIGridT } from "Models/APITypes"; import { CommonPopperModifiers } from "Common/Popper"; import { NewLabelName, StringToOption, OptionT } from "Common/Select"; import { DropdownSlide } from "Components/Animations/DropdownSlide"; diff --git a/ui/src/Components/Grid/AlertGrid/GridSize.ts b/ui/src/Components/Grid/AlertGrid/GridSize.ts index 827d2364d..b536b5b5b 100644 --- a/ui/src/Components/Grid/AlertGrid/GridSize.ts +++ b/ui/src/Components/Grid/AlertGrid/GridSize.ts @@ -1,4 +1,4 @@ -import { SizeDetail } from "bricks.js"; +import type { SizeDetail } from "bricks.js"; // grid sizes, defines how many columns are used depending on the screen width // this is config as expected by https://github.com/callmecavs/bricks.js#sizes diff --git a/ui/src/Components/Grid/AlertGrid/Swimlane.tsx b/ui/src/Components/Grid/AlertGrid/Swimlane.tsx index 297a30149..567fbcb4e 100644 --- a/ui/src/Components/Grid/AlertGrid/Swimlane.tsx +++ b/ui/src/Components/Grid/AlertGrid/Swimlane.tsx @@ -1,11 +1,11 @@ -import { FC, MouseEvent } from "react"; +import type { FC, MouseEvent } from "react"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faTh } from "@fortawesome/free-solid-svg-icons/faTh"; -import { AlertStore } from "Stores/AlertStore"; -import { Settings } from "Stores/Settings"; -import { APIGridT } from "Models/APITypes"; +import type { AlertStore } from "Stores/AlertStore"; +import type { Settings } from "Stores/Settings"; +import type { APIGridT } from "Models/APITypes"; import FilteringLabel from "Components/Labels/FilteringLabel"; import FilteringCounterBadge from "Components/Labels/FilteringCounterBadge"; import { TooltipWrapper } from "Components/TooltipWrapper"; diff --git a/ui/src/Components/Grid/AlertGrid/index.tsx b/ui/src/Components/Grid/AlertGrid/index.tsx index 2d88f9ba5..264b1c6e1 100644 --- a/ui/src/Components/Grid/AlertGrid/index.tsx +++ b/ui/src/Components/Grid/AlertGrid/index.tsx @@ -5,13 +5,13 @@ import { observer } from "mobx-react-lite"; import useDimensions from "react-cool-dimensions"; -import { SizeDetail } from "bricks.js"; +import type { SizeDetail } from "bricks.js"; import { useHotkeys } from "react-hotkeys-hook"; -import { AlertStore } from "Stores/AlertStore"; -import { Settings } from "Stores/Settings"; -import { SilenceFormStore } from "Stores/SilenceFormStore"; +import type { AlertStore } from "Stores/AlertStore"; +import type { Settings } from "Stores/Settings"; +import type { SilenceFormStore } from "Stores/SilenceFormStore"; import { useWindowSize } from "Hooks/useWindowSize"; import Grid from "./Grid"; import { GridSizesConfig, GetGridElementWidth } from "./GridSize"; diff --git a/ui/src/Components/Grid/EmptyGrid/index.tsx b/ui/src/Components/Grid/EmptyGrid/index.tsx index 25ec327de..4252ab752 100644 --- a/ui/src/Components/Grid/EmptyGrid/index.tsx +++ b/ui/src/Components/Grid/EmptyGrid/index.tsx @@ -1,4 +1,4 @@ -import { FC } from "react"; +import type { FC } from "react"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faMugHot } from "@fortawesome/free-solid-svg-icons/faMugHot"; diff --git a/ui/src/Components/Grid/FatalError/index.tsx b/ui/src/Components/Grid/FatalError/index.tsx index 1f02b02f1..a065e1473 100644 --- a/ui/src/Components/Grid/FatalError/index.tsx +++ b/ui/src/Components/Grid/FatalError/index.tsx @@ -1,4 +1,4 @@ -import { FC } from "react"; +import type { FC } from "react"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faExclamationCircle } from "@fortawesome/free-solid-svg-icons/faExclamationCircle"; diff --git a/ui/src/Components/Grid/index.tsx b/ui/src/Components/Grid/index.tsx index b7f005e23..8011e6d5a 100644 --- a/ui/src/Components/Grid/index.tsx +++ b/ui/src/Components/Grid/index.tsx @@ -1,10 +1,10 @@ -import { FC } from "react"; +import type { FC } from "react"; import { observer } from "mobx-react-lite"; -import { AlertStore } from "Stores/AlertStore"; -import { Settings } from "Stores/Settings"; -import { SilenceFormStore } from "Stores/SilenceFormStore"; +import type { AlertStore } from "Stores/AlertStore"; +import type { Settings } from "Stores/Settings"; +import type { SilenceFormStore } from "Stores/SilenceFormStore"; import AlertGrid from "./AlertGrid"; import { FatalError } from "./FatalError"; import { UpgradeNeeded } from "./UpgradeNeeded"; diff --git a/ui/src/Components/InhibitedByModal/InhibitedByModalContent.tsx b/ui/src/Components/InhibitedByModal/InhibitedByModalContent.tsx index 8076d4a17..94c1e3efa 100644 --- a/ui/src/Components/InhibitedByModal/InhibitedByModalContent.tsx +++ b/ui/src/Components/InhibitedByModal/InhibitedByModalContent.tsx @@ -1,6 +1,6 @@ -import { FC } from "react"; +import type { FC } from "react"; -import { AlertStore } from "Stores/AlertStore"; +import type { AlertStore } from "Stores/AlertStore"; import { FormatQuery, QueryOperators, StaticLabels } from "Common/Query"; import { PaginatedAlertList } from "Components/PaginatedAlertList"; diff --git a/ui/src/Components/InhibitedByModal/index.tsx b/ui/src/Components/InhibitedByModal/index.tsx index 7bcbbf53f..009ba5a9d 100644 --- a/ui/src/Components/InhibitedByModal/index.tsx +++ b/ui/src/Components/InhibitedByModal/index.tsx @@ -4,7 +4,7 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faSpinner } from "@fortawesome/free-solid-svg-icons/faSpinner"; import { faVolumeMute } from "@fortawesome/free-solid-svg-icons/faVolumeMute"; -import { AlertStore } from "Stores/AlertStore"; +import type { AlertStore } from "Stores/AlertStore"; import { TooltipWrapper } from "Components/TooltipWrapper"; import { Modal } from "Components/Modal"; diff --git a/ui/src/Components/LabelSetList/index.test.tsx b/ui/src/Components/LabelSetList/index.test.tsx index b9fb55c02..2aae602f3 100644 --- a/ui/src/Components/LabelSetList/index.test.tsx +++ b/ui/src/Components/LabelSetList/index.test.tsx @@ -2,7 +2,7 @@ import { mount } from "enzyme"; import toDiffableHtml from "diffable-html"; -import { LabelsT } from "Models/APITypes"; +import type { LabelsT } from "Models/APITypes"; import { AlertStore } from "Stores/AlertStore"; import { LabelSetList } from "."; diff --git a/ui/src/Components/LabelSetList/index.tsx b/ui/src/Components/LabelSetList/index.tsx index a803c47b9..b26a0953a 100644 --- a/ui/src/Components/LabelSetList/index.tsx +++ b/ui/src/Components/LabelSetList/index.tsx @@ -1,7 +1,7 @@ import { FC, useState } from "react"; -import { AlertStore } from "Stores/AlertStore"; -import { APIAlertGroupT } from "Models/APITypes"; +import type { AlertStore } from "Stores/AlertStore"; +import type { APIAlertGroupT } from "Models/APITypes"; import { IsMobile } from "Common/Device"; import { hashObject } from "Common/Hash"; import StaticLabel from "Components/Labels/StaticLabel"; diff --git a/ui/src/Components/Labels/FilterInputLabel/index.tsx b/ui/src/Components/Labels/FilterInputLabel/index.tsx index 1b0af9429..58bac1662 100644 --- a/ui/src/Components/Labels/FilterInputLabel/index.tsx +++ b/ui/src/Components/Labels/FilterInputLabel/index.tsx @@ -1,4 +1,4 @@ -import { FC } from "react"; +import type { FC } from "react"; import { observer } from "mobx-react-lite"; @@ -7,7 +7,7 @@ import { faExclamationCircle } from "@fortawesome/free-solid-svg-icons/faExclama import { faSpinner } from "@fortawesome/free-solid-svg-icons/faSpinner"; import { faTimes } from "@fortawesome/free-solid-svg-icons/faTimes"; -import { AlertStore, FilterT } from "Stores/AlertStore"; +import type { AlertStore, FilterT } from "Stores/AlertStore"; import { QueryOperators } from "Common/Query"; import { TooltipWrapper } from "Components/TooltipWrapper"; import { GetClassAndStyle } from "Components/Labels/Utils"; diff --git a/ui/src/Components/Labels/FilteringCounterBadge/index.tsx b/ui/src/Components/Labels/FilteringCounterBadge/index.tsx index 599f20884..7b281f574 100644 --- a/ui/src/Components/Labels/FilteringCounterBadge/index.tsx +++ b/ui/src/Components/Labels/FilteringCounterBadge/index.tsx @@ -4,7 +4,7 @@ import { observer } from "mobx-react-lite"; import { CSSTransition } from "react-transition-group"; -import { AlertStore } from "Stores/AlertStore"; +import type { AlertStore } from "Stores/AlertStore"; import { QueryOperators, FormatQuery } from "Common/Query"; import { TooltipWrapper } from "Components/TooltipWrapper"; import { GetClassAndStyle } from "Components/Labels/Utils"; diff --git a/ui/src/Components/Labels/FilteringLabel/index.tsx b/ui/src/Components/Labels/FilteringLabel/index.tsx index 92d807c20..402188d09 100644 --- a/ui/src/Components/Labels/FilteringLabel/index.tsx +++ b/ui/src/Components/Labels/FilteringLabel/index.tsx @@ -2,7 +2,7 @@ import { FC, useCallback, MouseEvent } from "react"; import { observer } from "mobx-react-lite"; -import { AlertStore } from "Stores/AlertStore"; +import type { AlertStore } from "Stores/AlertStore"; import { QueryOperators, FormatQuery } from "Common/Query"; import { TooltipWrapper } from "Components/TooltipWrapper"; import { GetClassAndStyle } from "Components/Labels/Utils"; diff --git a/ui/src/Components/Labels/HistoryLabel/index.tsx b/ui/src/Components/Labels/HistoryLabel/index.tsx index 30d0786e9..e3e5b1f14 100644 --- a/ui/src/Components/Labels/HistoryLabel/index.tsx +++ b/ui/src/Components/Labels/HistoryLabel/index.tsx @@ -1,9 +1,9 @@ -import { FC } from "react"; +import type { FC } from "react"; import { observer } from "mobx-react-lite"; import { QueryOperators } from "Common/Query"; -import { AlertStore } from "Stores/AlertStore"; +import type { AlertStore } from "Stores/AlertStore"; import { GetClassAndStyle } from "Components/Labels/Utils"; const HistoryLabel: FC<{ diff --git a/ui/src/Components/Labels/LabelWithPercent/index.tsx b/ui/src/Components/Labels/LabelWithPercent/index.tsx index af50e882f..ab8d95975 100644 --- a/ui/src/Components/Labels/LabelWithPercent/index.tsx +++ b/ui/src/Components/Labels/LabelWithPercent/index.tsx @@ -5,7 +5,7 @@ import { observer } from "mobx-react-lite"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faTimes } from "@fortawesome/free-solid-svg-icons/faTimes"; -import { AlertStore } from "Stores/AlertStore"; +import type { AlertStore } from "Stores/AlertStore"; import { QueryOperators, FormatQuery } from "Common/Query"; import { GetClassAndStyle } from "Components/Labels/Utils"; diff --git a/ui/src/Components/Labels/StaticLabel/index.tsx b/ui/src/Components/Labels/StaticLabel/index.tsx index 41aa0733e..dc521359f 100644 --- a/ui/src/Components/Labels/StaticLabel/index.tsx +++ b/ui/src/Components/Labels/StaticLabel/index.tsx @@ -1,8 +1,8 @@ -import { FC } from "react"; +import type { FC } from "react"; import { observer } from "mobx-react-lite"; -import { AlertStore } from "Stores/AlertStore"; +import type { AlertStore } from "Stores/AlertStore"; import { GetClassAndStyle } from "Components/Labels/Utils"; // Renders a static label element, no click actions, no hover diff --git a/ui/src/Components/Labels/Utils.ts b/ui/src/Components/Labels/Utils.ts index a7f685777..4ff7df111 100644 --- a/ui/src/Components/Labels/Utils.ts +++ b/ui/src/Components/Labels/Utils.ts @@ -5,8 +5,8 @@ import { StateLabelClassMap, } from "Common/Colors"; import { StaticLabels } from "Common/Query"; -import { AlertStateT } from "Models/APITypes"; -import { AlertStore } from "Stores/AlertStore"; +import type { AlertStateT } from "Models/APITypes"; +import type { AlertStore } from "Stores/AlertStore"; const isBackgroundDark = (brightness: number) => brightness <= 130; diff --git a/ui/src/Components/MainModal/Configuration/AlertGroupCollapseConfiguration.tsx b/ui/src/Components/MainModal/Configuration/AlertGroupCollapseConfiguration.tsx index 505383a69..147ba93bb 100644 --- a/ui/src/Components/MainModal/Configuration/AlertGroupCollapseConfiguration.tsx +++ b/ui/src/Components/MainModal/Configuration/AlertGroupCollapseConfiguration.tsx @@ -4,8 +4,8 @@ import { observer } from "mobx-react-lite"; import Select from "react-select"; -import { OptionT } from "Common/Select"; -import { Settings, CollapseStateT } from "Stores/Settings"; +import type { OptionT } from "Common/Select"; +import type { Settings, CollapseStateT } from "Stores/Settings"; import { AnimatedMenu } from "Components/Select"; import { ThemeContext } from "Components/Theme"; diff --git a/ui/src/Components/MainModal/Configuration/AlertGroupConfiguration.tsx b/ui/src/Components/MainModal/Configuration/AlertGroupConfiguration.tsx index 17b969e8b..031369637 100644 --- a/ui/src/Components/MainModal/Configuration/AlertGroupConfiguration.tsx +++ b/ui/src/Components/MainModal/Configuration/AlertGroupConfiguration.tsx @@ -2,7 +2,7 @@ import { FC, useState } from "react"; import { Range } from "react-range"; -import { Settings } from "Stores/Settings"; +import type { Settings } from "Stores/Settings"; const AlertGroupConfiguration: FC<{ settingsStore: Settings; diff --git a/ui/src/Components/MainModal/Configuration/AlertGroupSortConfiguration.tsx b/ui/src/Components/MainModal/Configuration/AlertGroupSortConfiguration.tsx index 9b01aba28..a78e06e1f 100644 --- a/ui/src/Components/MainModal/Configuration/AlertGroupSortConfiguration.tsx +++ b/ui/src/Components/MainModal/Configuration/AlertGroupSortConfiguration.tsx @@ -4,8 +4,8 @@ import { observer } from "mobx-react-lite"; import Select from "react-select"; -import { Settings, SortOrderT } from "Stores/Settings"; -import { OptionT } from "Common/Select"; +import type { Settings, SortOrderT } from "Stores/Settings"; +import type { OptionT } from "Common/Select"; import { ThemeContext } from "Components/Theme"; import { AnimatedMenu } from "Components/Select"; import { SortLabelName } from "./SortLabelName"; diff --git a/ui/src/Components/MainModal/Configuration/AlertGroupTitleBarColor.tsx b/ui/src/Components/MainModal/Configuration/AlertGroupTitleBarColor.tsx index 08bc84066..76908cac1 100644 --- a/ui/src/Components/MainModal/Configuration/AlertGroupTitleBarColor.tsx +++ b/ui/src/Components/MainModal/Configuration/AlertGroupTitleBarColor.tsx @@ -1,8 +1,8 @@ -import { FC } from "react"; +import type { FC } from "react"; import { observer } from "mobx-react-lite"; -import { Settings } from "Stores/Settings"; +import type { Settings } from "Stores/Settings"; const AlertGroupTitleBarColor: FC<{ settingsStore: Settings; diff --git a/ui/src/Components/MainModal/Configuration/AlertGroupWidthConfiguration.tsx b/ui/src/Components/MainModal/Configuration/AlertGroupWidthConfiguration.tsx index 2d7aed712..3ac168baa 100644 --- a/ui/src/Components/MainModal/Configuration/AlertGroupWidthConfiguration.tsx +++ b/ui/src/Components/MainModal/Configuration/AlertGroupWidthConfiguration.tsx @@ -4,7 +4,7 @@ import debounce from "lodash.debounce"; import { Range } from "react-range"; -import { Settings } from "Stores/Settings"; +import type { Settings } from "Stores/Settings"; const AlertGroupWidthConfiguration: FC<{ settingsStore: Settings; diff --git a/ui/src/Components/MainModal/Configuration/AnimationsConfiguration.tsx b/ui/src/Components/MainModal/Configuration/AnimationsConfiguration.tsx index 7231ffe65..f93fbfa65 100644 --- a/ui/src/Components/MainModal/Configuration/AnimationsConfiguration.tsx +++ b/ui/src/Components/MainModal/Configuration/AnimationsConfiguration.tsx @@ -1,8 +1,8 @@ -import { FC } from "react"; +import type { FC } from "react"; import { observer } from "mobx-react-lite"; -import { Settings } from "Stores/Settings"; +import type { Settings } from "Stores/Settings"; const AnimationsConfiguration: FC<{ settingsStore: Settings; diff --git a/ui/src/Components/MainModal/Configuration/FetchConfiguration.tsx b/ui/src/Components/MainModal/Configuration/FetchConfiguration.tsx index 140fa44e1..fc2d4b92b 100644 --- a/ui/src/Components/MainModal/Configuration/FetchConfiguration.tsx +++ b/ui/src/Components/MainModal/Configuration/FetchConfiguration.tsx @@ -2,7 +2,7 @@ import { FC, useState } from "react"; import { Range } from "react-range"; -import { Settings } from "Stores/Settings"; +import type { Settings } from "Stores/Settings"; const FetchConfiguration: FC<{ settingsStore: Settings; diff --git a/ui/src/Components/MainModal/Configuration/FilterBarConfiguration.tsx b/ui/src/Components/MainModal/Configuration/FilterBarConfiguration.tsx index d0d8360a5..cfdcf7575 100644 --- a/ui/src/Components/MainModal/Configuration/FilterBarConfiguration.tsx +++ b/ui/src/Components/MainModal/Configuration/FilterBarConfiguration.tsx @@ -1,8 +1,8 @@ -import { FC } from "react"; +import type { FC } from "react"; import { observer } from "mobx-react-lite"; -import { Settings } from "Stores/Settings"; +import type { Settings } from "Stores/Settings"; const FilterBarConfiguration: FC<{ settingsStore: Settings; diff --git a/ui/src/Components/MainModal/Configuration/GridLabelName.tsx b/ui/src/Components/MainModal/Configuration/GridLabelName.tsx index 807e59752..b05cbcf15 100644 --- a/ui/src/Components/MainModal/Configuration/GridLabelName.tsx +++ b/ui/src/Components/MainModal/Configuration/GridLabelName.tsx @@ -4,7 +4,7 @@ import Creatable from "react-select/creatable"; import { useFetchGet } from "Hooks/useFetchGet"; import { FormatBackendURI } from "Stores/AlertStore"; -import { Settings } from "Stores/Settings"; +import type { Settings } from "Stores/Settings"; import { ThemeContext } from "Components/Theme"; import { AnimatedMenu } from "Components/Select"; import { NewLabelName, StringToOption, OptionT } from "Common/Select"; diff --git a/ui/src/Components/MainModal/Configuration/MultiGridConfiguration.tsx b/ui/src/Components/MainModal/Configuration/MultiGridConfiguration.tsx index 1d0c18d00..17eec0ce1 100644 --- a/ui/src/Components/MainModal/Configuration/MultiGridConfiguration.tsx +++ b/ui/src/Components/MainModal/Configuration/MultiGridConfiguration.tsx @@ -1,8 +1,8 @@ -import { FC } from "react"; +import type { FC } from "react"; import { observer } from "mobx-react-lite"; -import { Settings } from "Stores/Settings"; +import type { Settings } from "Stores/Settings"; import { GridLabelName } from "./GridLabelName"; const MultiGridConfiguration: FC<{ diff --git a/ui/src/Components/MainModal/Configuration/SortLabelName.tsx b/ui/src/Components/MainModal/Configuration/SortLabelName.tsx index 6057d1495..1268f0961 100644 --- a/ui/src/Components/MainModal/Configuration/SortLabelName.tsx +++ b/ui/src/Components/MainModal/Configuration/SortLabelName.tsx @@ -3,9 +3,9 @@ import React, { FC } from "react"; import Creatable from "react-select/creatable"; import { StaticLabels } from "Common/Query"; -import { OptionT } from "Common/Select"; +import type { OptionT } from "Common/Select"; import { FormatBackendURI } from "Stores/AlertStore"; -import { Settings } from "Stores/Settings"; +import type { Settings } from "Stores/Settings"; import { useFetchGet } from "Hooks/useFetchGet"; import { ThemeContext } from "Components/Theme"; import { AnimatedMenu } from "Components/Select"; diff --git a/ui/src/Components/MainModal/Configuration/ThemeConfiguration.tsx b/ui/src/Components/MainModal/Configuration/ThemeConfiguration.tsx index e4ba7a248..0e9b8fec6 100644 --- a/ui/src/Components/MainModal/Configuration/ThemeConfiguration.tsx +++ b/ui/src/Components/MainModal/Configuration/ThemeConfiguration.tsx @@ -4,8 +4,8 @@ import { observer } from "mobx-react-lite"; import Select from "react-select"; -import { OptionT } from "Common/Select"; -import { Settings, ThemeT } from "Stores/Settings"; +import type { OptionT } from "Common/Select"; +import type { Settings, ThemeT } from "Stores/Settings"; import { AnimatedMenu } from "Components/Select"; import { ThemeContext } from "Components/Theme"; diff --git a/ui/src/Components/MainModal/Configuration/index.tsx b/ui/src/Components/MainModal/Configuration/index.tsx index 10c99bcfe..1f9191cb5 100644 --- a/ui/src/Components/MainModal/Configuration/index.tsx +++ b/ui/src/Components/MainModal/Configuration/index.tsx @@ -1,6 +1,6 @@ -import { FC } from "react"; +import type { FC } from "react"; -import { Settings } from "Stores/Settings"; +import type { Settings } from "Stores/Settings"; import { Accordion, AccordionItem } from "Components/Accordion"; import { FetchConfiguration } from "./FetchConfiguration"; import { FilterBarConfiguration } from "./FilterBarConfiguration"; diff --git a/ui/src/Components/MainModal/Help.tsx b/ui/src/Components/MainModal/Help.tsx index 10519eaf3..ef89734d9 100644 --- a/ui/src/Components/MainModal/Help.tsx +++ b/ui/src/Components/MainModal/Help.tsx @@ -1,4 +1,4 @@ -import { FC, ReactNode } from "react"; +import type { FC, ReactNode } from "react"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faInfoCircle } from "@fortawesome/free-solid-svg-icons/faInfoCircle"; diff --git a/ui/src/Components/MainModal/MainModalContent.tsx b/ui/src/Components/MainModal/MainModalContent.tsx index 1011bba70..c00088b45 100644 --- a/ui/src/Components/MainModal/MainModalContent.tsx +++ b/ui/src/Components/MainModal/MainModalContent.tsx @@ -2,8 +2,8 @@ import { FC, useState } from "react"; import { Observer } from "mobx-react-lite"; -import { AlertStore } from "Stores/AlertStore"; -import { Settings } from "Stores/Settings"; +import type { AlertStore } from "Stores/AlertStore"; +import type { Settings } from "Stores/Settings"; import { Tab } from "Components/Modal/Tab"; import { Configuration } from "./Configuration"; import { Help } from "./Help"; diff --git a/ui/src/Components/MainModal/index.tsx b/ui/src/Components/MainModal/index.tsx index a607457d9..0e8bf804d 100644 --- a/ui/src/Components/MainModal/index.tsx +++ b/ui/src/Components/MainModal/index.tsx @@ -4,8 +4,8 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faSlidersH } from "@fortawesome/free-solid-svg-icons/faSlidersH"; import { faSpinner } from "@fortawesome/free-solid-svg-icons/faSpinner"; -import { AlertStore } from "Stores/AlertStore"; -import { Settings } from "Stores/Settings"; +import type { AlertStore } from "Stores/AlertStore"; +import type { Settings } from "Stores/Settings"; import { TooltipWrapper } from "Components/TooltipWrapper"; import { Modal } from "Components/Modal"; diff --git a/ui/src/Components/ManagedSilence/DeleteSilence.test.tsx b/ui/src/Components/ManagedSilence/DeleteSilence.test.tsx index 8b634f3e9..481a8bd67 100644 --- a/ui/src/Components/ManagedSilence/DeleteSilence.test.tsx +++ b/ui/src/Components/ManagedSilence/DeleteSilence.test.tsx @@ -7,7 +7,7 @@ import { advanceTo, clear } from "jest-date-mock"; import { MockSilence } from "__fixtures__/Alerts"; import { PressKey } from "__fixtures__/PressKey"; import { useFetchDelete } from "Hooks/useFetchDelete"; -import { APISilenceT, APIAlertsResponseUpstreamsT } from "Models/APITypes"; +import type { APISilenceT, APIAlertsResponseUpstreamsT } from "Models/APITypes"; import { AlertStore } from "Stores/AlertStore"; import { SilenceFormStore } from "Stores/SilenceFormStore"; import { DeleteSilence, DeleteSilenceModalContent } from "./DeleteSilence"; diff --git a/ui/src/Components/ManagedSilence/DeleteSilence.tsx b/ui/src/Components/ManagedSilence/DeleteSilence.tsx index 334faec3c..67cd774ac 100644 --- a/ui/src/Components/ManagedSilence/DeleteSilence.tsx +++ b/ui/src/Components/ManagedSilence/DeleteSilence.tsx @@ -7,9 +7,9 @@ import { faCheckCircle } from "@fortawesome/free-solid-svg-icons/faCheckCircle"; import { faRedo } from "@fortawesome/free-solid-svg-icons/faRedo"; import { faCircleNotch } from "@fortawesome/free-solid-svg-icons/faCircleNotch"; -import { APISilenceT } from "Models/APITypes"; -import { AlertStore } from "Stores/AlertStore"; -import { SilenceFormStore } from "Stores/SilenceFormStore"; +import type { APISilenceT } from "Models/APITypes"; +import type { AlertStore } from "Stores/AlertStore"; +import type { SilenceFormStore } from "Stores/SilenceFormStore"; import { FormatQuery, QueryOperators, StaticLabels } from "Common/Query"; import { useFetchDelete } from "Hooks/useFetchDelete"; import { Modal } from "Components/Modal"; diff --git a/ui/src/Components/ManagedSilence/SilenceComment.test.tsx b/ui/src/Components/ManagedSilence/SilenceComment.test.tsx index 24926cde8..e1e656570 100644 --- a/ui/src/Components/ManagedSilence/SilenceComment.test.tsx +++ b/ui/src/Components/ManagedSilence/SilenceComment.test.tsx @@ -5,7 +5,7 @@ import { advanceTo, clear } from "jest-date-mock"; import toDiffableHtml from "diffable-html"; import { MockSilence } from "__fixtures__/Alerts"; -import { APISilenceT } from "Models/APITypes"; +import type { APISilenceT } from "Models/APITypes"; import { AlertStore } from "Stores/AlertStore"; import { SilenceComment } from "./SilenceComment"; diff --git a/ui/src/Components/ManagedSilence/SilenceComment.tsx b/ui/src/Components/ManagedSilence/SilenceComment.tsx index 6bd276b97..341add63d 100644 --- a/ui/src/Components/ManagedSilence/SilenceComment.tsx +++ b/ui/src/Components/ManagedSilence/SilenceComment.tsx @@ -1,11 +1,11 @@ -import { FC } from "react"; +import type { FC } from "react"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faExternalLinkAlt } from "@fortawesome/free-solid-svg-icons/faExternalLinkAlt"; import { faBellSlash } from "@fortawesome/free-solid-svg-icons/faBellSlash"; -import { APISilenceT } from "Models/APITypes"; -import { AlertStore } from "Stores/AlertStore"; +import type { APISilenceT } from "Models/APITypes"; +import type { AlertStore } from "Stores/AlertStore"; import FilteringCounterBadge from "Components/Labels/FilteringCounterBadge"; import { ToggleIcon } from "Components/ToggleIcon"; import { SilenceProgress } from "./SilenceProgress"; diff --git a/ui/src/Components/ManagedSilence/SilenceDetails.test.tsx b/ui/src/Components/ManagedSilence/SilenceDetails.test.tsx index ddc57ba74..2e105c96e 100644 --- a/ui/src/Components/ManagedSilence/SilenceDetails.test.tsx +++ b/ui/src/Components/ManagedSilence/SilenceDetails.test.tsx @@ -7,7 +7,7 @@ import copy from "copy-to-clipboard"; import { advanceTo, clear } from "jest-date-mock"; import { MockSilence } from "__fixtures__/Alerts"; -import { APIAlertsResponseUpstreamsT, APISilenceT } from "Models/APITypes"; +import type { APIAlertsResponseUpstreamsT, APISilenceT } from "Models/APITypes"; import { AlertStore } from "Stores/AlertStore"; import { SilenceFormStore } from "Stores/SilenceFormStore"; import { SilenceDetails } from "./SilenceDetails"; diff --git a/ui/src/Components/ManagedSilence/SilenceDetails.tsx b/ui/src/Components/ManagedSilence/SilenceDetails.tsx index b2e8cd5c6..51da10264 100644 --- a/ui/src/Components/ManagedSilence/SilenceDetails.tsx +++ b/ui/src/Components/ManagedSilence/SilenceDetails.tsx @@ -15,8 +15,8 @@ import { faHome } from "@fortawesome/free-solid-svg-icons/faHome"; import { faFingerprint } from "@fortawesome/free-solid-svg-icons/faFingerprint"; import { faCopy } from "@fortawesome/free-solid-svg-icons/faCopy"; -import { APISilenceT } from "Models/APITypes"; -import { AlertStore } from "Stores/AlertStore"; +import type { APISilenceT } from "Models/APITypes"; +import type { AlertStore } from "Stores/AlertStore"; import { SilenceFormStore, MatcherToOperator } from "Stores/SilenceFormStore"; import { TooltipWrapper } from "Components/TooltipWrapper"; import { RenderLinkAnnotation } from "Components/Grid/AlertGrid/AlertGroup/Annotation"; diff --git a/ui/src/Components/ManagedSilence/SilenceProgress.test.tsx b/ui/src/Components/ManagedSilence/SilenceProgress.test.tsx index 0776e3455..f0be80821 100644 --- a/ui/src/Components/ManagedSilence/SilenceProgress.test.tsx +++ b/ui/src/Components/ManagedSilence/SilenceProgress.test.tsx @@ -7,7 +7,7 @@ import toDiffableHtml from "diffable-html"; import { advanceTo, clear } from "jest-date-mock"; import { MockSilence } from "__fixtures__/Alerts"; -import { APISilenceT } from "Models/APITypes"; +import type { APISilenceT } from "Models/APITypes"; import { SilenceProgress } from "./SilenceProgress"; let silence: APISilenceT; diff --git a/ui/src/Components/ManagedSilence/SilenceProgress.tsx b/ui/src/Components/ManagedSilence/SilenceProgress.tsx index 8c95c476b..d218c01d2 100644 --- a/ui/src/Components/ManagedSilence/SilenceProgress.tsx +++ b/ui/src/Components/ManagedSilence/SilenceProgress.tsx @@ -5,7 +5,7 @@ import { observer } from "mobx-react-lite"; import parseISO from "date-fns/parseISO"; import getUnixTime from "date-fns/getUnixTime"; -import { APISilenceT } from "Models/APITypes"; +import type { APISilenceT } from "Models/APITypes"; import { DateFromNow } from "Components/DateFromNow"; const calculatePercent = (startsAt: string, endsAt: string) => { diff --git a/ui/src/Components/ManagedSilence/index.test.tsx b/ui/src/Components/ManagedSilence/index.test.tsx index d29d41415..0ef142a01 100644 --- a/ui/src/Components/ManagedSilence/index.test.tsx +++ b/ui/src/Components/ManagedSilence/index.test.tsx @@ -6,7 +6,7 @@ import { advanceTo, clear } from "jest-date-mock"; import { MockSilence } from "__fixtures__/Alerts"; import { MockThemeContext } from "__fixtures__/Theme"; -import { APISilenceT } from "Models/APITypes"; +import type { APISilenceT } from "Models/APITypes"; import { AlertStore } from "Stores/AlertStore"; import { SilenceFormStore } from "Stores/SilenceFormStore"; import { ThemeContext } from "Components/Theme"; diff --git a/ui/src/Components/ManagedSilence/index.tsx b/ui/src/Components/ManagedSilence/index.tsx index 75c3d8959..0825b85b4 100644 --- a/ui/src/Components/ManagedSilence/index.tsx +++ b/ui/src/Components/ManagedSilence/index.tsx @@ -1,8 +1,8 @@ import { FC, useEffect, useState } from "react"; -import { APISilenceT, APIAlertmanagerUpstreamT } from "Models/APITypes"; -import { AlertStore } from "Stores/AlertStore"; -import { SilenceFormStore } from "Stores/SilenceFormStore"; +import type { APISilenceT, APIAlertmanagerUpstreamT } from "Models/APITypes"; +import type { AlertStore } from "Stores/AlertStore"; +import type { SilenceFormStore } from "Stores/SilenceFormStore"; import { SilenceComment } from "./SilenceComment"; import { SilenceDetails } from "./SilenceDetails"; diff --git a/ui/src/Components/Modal/Tab.tsx b/ui/src/Components/Modal/Tab.tsx index ae0bb2313..18caaaf47 100644 --- a/ui/src/Components/Modal/Tab.tsx +++ b/ui/src/Components/Modal/Tab.tsx @@ -1,4 +1,4 @@ -import { FC, MouseEvent } from "react"; +import type { FC, MouseEvent } from "react"; const Tab: FC<{ title: string; diff --git a/ui/src/Components/NavBar/FilterInput/History.tsx b/ui/src/Components/NavBar/FilterInput/History.tsx index d83982898..018284512 100644 --- a/ui/src/Components/NavBar/FilterInput/History.tsx +++ b/ui/src/Components/NavBar/FilterInput/History.tsx @@ -15,7 +15,7 @@ import { localStored } from "mobx-stored"; import { Manager, Reference, Popper } from "react-popper"; -import { IconDefinition } from "@fortawesome/fontawesome-svg-core"; +import type { IconDefinition } from "@fortawesome/fontawesome-svg-core"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faHistory } from "@fortawesome/free-solid-svg-icons/faHistory"; import { faCaretDown } from "@fortawesome/free-solid-svg-icons/faCaretDown"; @@ -23,8 +23,8 @@ import { faSave } from "@fortawesome/free-regular-svg-icons/faSave"; import { faUndoAlt } from "@fortawesome/free-solid-svg-icons/faUndoAlt"; import { faTrash } from "@fortawesome/free-solid-svg-icons/faTrash"; -import { AlertStore, FilterT } from "Stores/AlertStore"; -import { Settings } from "Stores/Settings"; +import type { AlertStore, FilterT } from "Stores/AlertStore"; +import type { Settings } from "Stores/Settings"; import { IsMobile } from "Common/Device"; import { CommonPopperModifiers } from "Common/Popper"; import { DropdownSlide } from "Components/Animations/DropdownSlide"; diff --git a/ui/src/Components/NavBar/FilterInput/index.tsx b/ui/src/Components/NavBar/FilterInput/index.tsx index cbb2d8704..fda64e13a 100644 --- a/ui/src/Components/NavBar/FilterInput/index.tsx +++ b/ui/src/Components/NavBar/FilterInput/index.tsx @@ -12,7 +12,7 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faSearch } from "@fortawesome/free-solid-svg-icons/faSearch"; import { AlertStore, FormatBackendURI } from "Stores/AlertStore"; -import { Settings } from "Stores/Settings"; +import type { Settings } from "Stores/Settings"; import { IsMobile } from "Common/Device"; import { useFetchGet } from "Hooks/useFetchGet"; import { useDebounce } from "Hooks/useDebounce"; diff --git a/ui/src/Components/NavBar/index.tsx b/ui/src/Components/NavBar/index.tsx index f186e4a2b..ef156df36 100644 --- a/ui/src/Components/NavBar/index.tsx +++ b/ui/src/Components/NavBar/index.tsx @@ -9,9 +9,9 @@ import { useIdleTimer } from "react-idle-timer"; import { CSSTransition } from "react-transition-group"; -import { AlertStore } from "Stores/AlertStore"; -import { Settings } from "Stores/Settings"; -import { SilenceFormStore } from "Stores/SilenceFormStore"; +import type { AlertStore } from "Stores/AlertStore"; +import type { Settings } from "Stores/Settings"; +import type { SilenceFormStore } from "Stores/SilenceFormStore"; import { IsMobile } from "Common/Device"; import { OverviewModal } from "Components/OverviewModal"; import { MainModal } from "Components/MainModal"; diff --git a/ui/src/Components/OverviewModal/OverviewModalContent.tsx b/ui/src/Components/OverviewModal/OverviewModalContent.tsx index a4809246b..15c8eb488 100644 --- a/ui/src/Components/OverviewModal/OverviewModalContent.tsx +++ b/ui/src/Components/OverviewModal/OverviewModalContent.tsx @@ -2,8 +2,8 @@ import { FC, useState } from "react"; import { observer } from "mobx-react-lite"; -import { APILabelCounterT } from "Models/APITypes"; -import { AlertStore } from "Stores/AlertStore"; +import type { APILabelCounterT } from "Models/APITypes"; +import type { AlertStore } from "Stores/AlertStore"; import { TooltipWrapper } from "Components/TooltipWrapper"; import LabelWithPercent from "Components/Labels/LabelWithPercent"; import { ToggleIcon } from "Components/ToggleIcon"; diff --git a/ui/src/Components/OverviewModal/index.stories.tsx b/ui/src/Components/OverviewModal/index.stories.tsx index a8497bfc0..a03ca0d21 100644 --- a/ui/src/Components/OverviewModal/index.stories.tsx +++ b/ui/src/Components/OverviewModal/index.stories.tsx @@ -1,4 +1,4 @@ -import { FC } from "react"; +import type { FC } from "react"; import { storiesOf } from "@storybook/react"; diff --git a/ui/src/Components/OverviewModal/index.tsx b/ui/src/Components/OverviewModal/index.tsx index acdbd1d6d..8f30c744f 100644 --- a/ui/src/Components/OverviewModal/index.tsx +++ b/ui/src/Components/OverviewModal/index.tsx @@ -7,7 +7,7 @@ import { CSSTransition } from "react-transition-group"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faSpinner } from "@fortawesome/free-solid-svg-icons/faSpinner"; -import { AlertStore } from "Stores/AlertStore"; +import type { AlertStore } from "Stores/AlertStore"; import { useFlashTransition } from "Hooks/useFlashTransition"; import { TooltipWrapper } from "Components/TooltipWrapper"; import { Modal } from "Components/Modal"; diff --git a/ui/src/Components/PaginatedAlertList/index.tsx b/ui/src/Components/PaginatedAlertList/index.tsx index e398fea68..190f57d10 100644 --- a/ui/src/Components/PaginatedAlertList/index.tsx +++ b/ui/src/Components/PaginatedAlertList/index.tsx @@ -1,10 +1,10 @@ -import { FC, ReactNode } from "react"; +import type { FC, ReactNode } from "react"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faExclamationCircle } from "@fortawesome/free-solid-svg-icons/faExclamationCircle"; import { faSpinner } from "@fortawesome/free-solid-svg-icons/faSpinner"; -import { APIAlertsResponseT } from "Models/APITypes"; +import type { APIAlertsResponseT } from "Models/APITypes"; import { AlertStore, FormatBackendURI, FormatAlertsQ } from "Stores/AlertStore"; import { LabelSetList, diff --git a/ui/src/Components/Select/index.tsx b/ui/src/Components/Select/index.tsx index 9243a208c..4606e47a3 100644 --- a/ui/src/Components/Select/index.tsx +++ b/ui/src/Components/Select/index.tsx @@ -1,9 +1,9 @@ -import { FC } from "react"; +import type { FC } from "react"; import { components, MenuProps } from "react-select"; import { DropdownSlide } from "Components/Animations/DropdownSlide"; -import { OptionT, MultiValueOptionT } from "Common/Select"; +import type { OptionT, MultiValueOptionT } from "Common/Select"; export const AnimatedMenu: FC> = (props) => { return ( diff --git a/ui/src/Components/SilenceModal/AlertManagerInput/index.test.tsx b/ui/src/Components/SilenceModal/AlertManagerInput/index.test.tsx index 8eea9d896..ee55622e7 100644 --- a/ui/src/Components/SilenceModal/AlertManagerInput/index.test.tsx +++ b/ui/src/Components/SilenceModal/AlertManagerInput/index.test.tsx @@ -7,7 +7,7 @@ import { AlertStore } from "Stores/AlertStore"; import { SilenceFormStore } from "Stores/SilenceFormStore"; import { ThemeContext } from "Components/Theme"; import { AlertManagerInput } from "."; -import { APIAlertsResponseUpstreamsT } from "Models/APITypes"; +import type { APIAlertsResponseUpstreamsT } from "Models/APITypes"; let alertStore: AlertStore; let silenceFormStore: SilenceFormStore; diff --git a/ui/src/Components/SilenceModal/AlertManagerInput/index.tsx b/ui/src/Components/SilenceModal/AlertManagerInput/index.tsx index 802255953..305e3e838 100644 --- a/ui/src/Components/SilenceModal/AlertManagerInput/index.tsx +++ b/ui/src/Components/SilenceModal/AlertManagerInput/index.tsx @@ -5,12 +5,12 @@ import { observer } from "mobx-react-lite"; import Select from "react-select"; -import { AlertStore } from "Stores/AlertStore"; +import type { AlertStore } from "Stores/AlertStore"; import { SilenceFormStore, AlertmanagerClustersToOption, } from "Stores/SilenceFormStore"; -import { MultiValueOptionT } from "Common/Select"; +import type { MultiValueOptionT } from "Common/Select"; import { ThemeContext } from "Components/Theme"; import { AnimatedMultiMenu } from "Components/Select"; import { ValidationError } from "Components/ValidationError"; diff --git a/ui/src/Components/SilenceModal/AuthorInput.tsx b/ui/src/Components/SilenceModal/AuthorInput.tsx index d5681ceb5..600aa98cf 100644 --- a/ui/src/Components/SilenceModal/AuthorInput.tsx +++ b/ui/src/Components/SilenceModal/AuthorInput.tsx @@ -1,10 +1,10 @@ -import { FC, ChangeEvent } from "react"; +import type { FC, ChangeEvent } from "react"; -import { IconDefinition } from "@fortawesome/fontawesome-svg-core"; +import type { IconDefinition } from "@fortawesome/fontawesome-svg-core"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faUser } from "@fortawesome/free-solid-svg-icons/faUser"; -import { AlertStore } from "Stores/AlertStore"; +import type { AlertStore } from "Stores/AlertStore"; const IconInput: FC<{ type: string; diff --git a/ui/src/Components/SilenceModal/Browser/index.test.tsx b/ui/src/Components/SilenceModal/Browser/index.test.tsx index 72b3d98b1..17177faee 100644 --- a/ui/src/Components/SilenceModal/Browser/index.test.tsx +++ b/ui/src/Components/SilenceModal/Browser/index.test.tsx @@ -10,7 +10,7 @@ import { useFetchGetMock } from "__fixtures__/useFetchGet"; import { MockSilence } from "__fixtures__/Alerts"; import { PressKey } from "__fixtures__/PressKey"; import { MockThemeContext } from "__fixtures__/Theme"; -import { APISilenceT, APIManagedSilenceT } from "Models/APITypes"; +import type { APISilenceT, APIManagedSilenceT } from "Models/APITypes"; import { AlertStore } from "Stores/AlertStore"; import { Settings } from "Stores/Settings"; import { SilenceFormStore } from "Stores/SilenceFormStore"; diff --git a/ui/src/Components/SilenceModal/Browser/index.tsx b/ui/src/Components/SilenceModal/Browser/index.tsx index 1e88e1596..3f0c25bcb 100644 --- a/ui/src/Components/SilenceModal/Browser/index.tsx +++ b/ui/src/Components/SilenceModal/Browser/index.tsx @@ -11,10 +11,10 @@ import { faExclamationCircle } from "@fortawesome/free-solid-svg-icons/faExclama import { faSortAmountDownAlt } from "@fortawesome/free-solid-svg-icons/faSortAmountDownAlt"; import { faSortAmountUp } from "@fortawesome/free-solid-svg-icons/faSortAmountUp"; -import { APIManagedSilenceT } from "Models/APITypes"; +import type { APIManagedSilenceT } from "Models/APITypes"; import { AlertStore, FormatBackendURI } from "Stores/AlertStore"; -import { SilenceFormStore } from "Stores/SilenceFormStore"; -import { Settings } from "Stores/Settings"; +import type { SilenceFormStore } from "Stores/SilenceFormStore"; +import type { Settings } from "Stores/Settings"; import { useFetchGet, FetchGetOptionsT } from "Hooks/useFetchGet"; import { useDebounce } from "Hooks/useDebounce"; import { IsMobile } from "Common/Device"; diff --git a/ui/src/Components/SilenceModal/DateTimeSelect/HourMinute.tsx b/ui/src/Components/SilenceModal/DateTimeSelect/HourMinute.tsx index b20cd2c29..387ca11e2 100644 --- a/ui/src/Components/SilenceModal/DateTimeSelect/HourMinute.tsx +++ b/ui/src/Components/SilenceModal/DateTimeSelect/HourMinute.tsx @@ -2,7 +2,7 @@ import { FC, useEffect, useRef, MouseEvent, WheelEvent } from "react"; import { observer } from "mobx-react-lite"; -import { IconDefinition } from "@fortawesome/fontawesome-svg-core"; +import type { IconDefinition } from "@fortawesome/fontawesome-svg-core"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faAngleUp } from "@fortawesome/free-solid-svg-icons/faAngleUp"; import { faAngleDown } from "@fortawesome/free-solid-svg-icons/faAngleDown"; diff --git a/ui/src/Components/SilenceModal/DateTimeSelect/index.tsx b/ui/src/Components/SilenceModal/DateTimeSelect/index.tsx index 4a48cad4c..45616e0f6 100644 --- a/ui/src/Components/SilenceModal/DateTimeSelect/index.tsx +++ b/ui/src/Components/SilenceModal/DateTimeSelect/index.tsx @@ -10,7 +10,7 @@ import setSeconds from "date-fns/setSeconds"; import DayPicker from "react-day-picker"; import "react-day-picker/lib/style.css"; -import { SilenceFormStore } from "Stores/SilenceFormStore"; +import type { SilenceFormStore } from "Stores/SilenceFormStore"; import { Duration } from "./Duration"; import { HourMinute } from "./HourMinute"; diff --git a/ui/src/Components/SilenceModal/Matchers.ts b/ui/src/Components/SilenceModal/Matchers.ts index e6572f4a1..b30c2ecf9 100644 --- a/ui/src/Components/SilenceModal/Matchers.ts +++ b/ui/src/Components/SilenceModal/Matchers.ts @@ -1,5 +1,5 @@ import { FormatQuery, QueryOperators, StaticLabels } from "Common/Query"; -import { MultiValueOptionT } from "Common/Select"; +import type { MultiValueOptionT } from "Common/Select"; import { MatcherT, MatcherToOperator } from "Stores/SilenceFormStore"; const MatcherToFilter = (matcher: MatcherT): string => { diff --git a/ui/src/Components/SilenceModal/PayloadPreview/index.tsx b/ui/src/Components/SilenceModal/PayloadPreview/index.tsx index d890c5406..7255c20b1 100644 --- a/ui/src/Components/SilenceModal/PayloadPreview/index.tsx +++ b/ui/src/Components/SilenceModal/PayloadPreview/index.tsx @@ -1,11 +1,11 @@ -import { FC } from "react"; +import type { FC } from "react"; import { observer } from "mobx-react-lite"; import JSONPretty from "react-json-pretty"; import * as theme from "react-json-pretty/dist/monikai"; -import { SilenceFormStore } from "Stores/SilenceFormStore"; +import type { SilenceFormStore } from "Stores/SilenceFormStore"; const PayloadPreview: FC<{ silenceFormStore: SilenceFormStore; diff --git a/ui/src/Components/SilenceModal/SilenceForm.test.tsx b/ui/src/Components/SilenceModal/SilenceForm.test.tsx index de74d24b9..cbeb2b3e4 100644 --- a/ui/src/Components/SilenceModal/SilenceForm.test.tsx +++ b/ui/src/Components/SilenceModal/SilenceForm.test.tsx @@ -9,7 +9,7 @@ import { SilenceFormStore, NewEmptyMatcher } from "Stores/SilenceFormStore"; import { QueryOperators, StaticLabels } from "Common/Query"; import { ThemeContext } from "Components/Theme"; import SilenceForm from "./SilenceForm"; -import { APIAlertsResponseUpstreamsT } from "Models/APITypes"; +import type { APIAlertsResponseUpstreamsT } from "Models/APITypes"; let alertStore: AlertStore; let settingsStore: Settings; diff --git a/ui/src/Components/SilenceModal/SilenceForm.tsx b/ui/src/Components/SilenceModal/SilenceForm.tsx index fc825c595..a6b599d25 100644 --- a/ui/src/Components/SilenceModal/SilenceForm.tsx +++ b/ui/src/Components/SilenceModal/SilenceForm.tsx @@ -17,14 +17,14 @@ import { faSearch } from "@fortawesome/free-solid-svg-icons/faSearch"; import { faShareAlt } from "@fortawesome/free-solid-svg-icons/faShareAlt"; import { faCopy } from "@fortawesome/free-solid-svg-icons/faCopy"; -import { AlertStore } from "Stores/AlertStore"; +import type { AlertStore } from "Stores/AlertStore"; import { SilenceFormStore, NewEmptyMatcher, NewClusterRequest, ClusterRequestT, } from "Stores/SilenceFormStore"; -import { Settings } from "Stores/Settings"; +import type { Settings } from "Stores/Settings"; import { StringToOption } from "Common/Select"; import { QueryOperators } from "Common/Query"; import { useFlashTransition } from "Hooks/useFlashTransition"; diff --git a/ui/src/Components/SilenceModal/SilenceMatch/LabelNameInput.tsx b/ui/src/Components/SilenceModal/SilenceMatch/LabelNameInput.tsx index 9205b093d..790a64f13 100644 --- a/ui/src/Components/SilenceModal/SilenceMatch/LabelNameInput.tsx +++ b/ui/src/Components/SilenceModal/SilenceMatch/LabelNameInput.tsx @@ -3,7 +3,7 @@ import React, { FC } from "react"; import Creatable from "react-select/creatable"; import { FormatBackendURI } from "Stores/AlertStore"; -import { MatcherWithIDT } from "Stores/SilenceFormStore"; +import type { MatcherWithIDT } from "Stores/SilenceFormStore"; import { useFetchGet } from "Hooks/useFetchGet"; import { ValidationError } from "Components/ValidationError"; import { ThemeContext } from "Components/Theme"; diff --git a/ui/src/Components/SilenceModal/SilenceMatch/LabelValueInput.tsx b/ui/src/Components/SilenceModal/SilenceMatch/LabelValueInput.tsx index 70b3a2157..3f06e3275 100644 --- a/ui/src/Components/SilenceModal/SilenceMatch/LabelValueInput.tsx +++ b/ui/src/Components/SilenceModal/SilenceMatch/LabelValueInput.tsx @@ -10,7 +10,7 @@ import { import Creatable from "react-select/creatable"; import { FormatBackendURI } from "Stores/AlertStore"; -import { SilenceFormStore, MatcherWithIDT } from "Stores/SilenceFormStore"; +import type { SilenceFormStore, MatcherWithIDT } from "Stores/SilenceFormStore"; import { useFetchGet } from "Hooks/useFetchGet"; import { hashObject } from "Common/Hash"; import { NewLabelValue, OptionT, StringToOption } from "Common/Select"; diff --git a/ui/src/Components/SilenceModal/SilenceMatch/MatchCounter.tsx b/ui/src/Components/SilenceModal/SilenceMatch/MatchCounter.tsx index f8c738f4b..d55f84055 100644 --- a/ui/src/Components/SilenceModal/SilenceMatch/MatchCounter.tsx +++ b/ui/src/Components/SilenceModal/SilenceMatch/MatchCounter.tsx @@ -1,4 +1,4 @@ -import { FC } from "react"; +import type { FC } from "react"; import { observer } from "mobx-react-lite"; @@ -6,9 +6,9 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faExclamationCircle } from "@fortawesome/free-solid-svg-icons/faExclamationCircle"; import { faSpinner } from "@fortawesome/free-solid-svg-icons/faSpinner"; -import { APIAlertsResponseT } from "Models/APITypes"; +import type { APIAlertsResponseT } from "Models/APITypes"; import { FormatBackendURI, FormatAlertsQ } from "Stores/AlertStore"; -import { SilenceFormStore, MatcherWithIDT } from "Stores/SilenceFormStore"; +import type { SilenceFormStore, MatcherWithIDT } from "Stores/SilenceFormStore"; import { TooltipWrapper } from "Components/TooltipWrapper"; import { useFetchGet } from "Hooks/useFetchGet"; import { MatcherToFilter, AlertManagersToFilter } from "../Matchers"; diff --git a/ui/src/Components/SilenceModal/SilenceMatch/index.tsx b/ui/src/Components/SilenceModal/SilenceMatch/index.tsx index 5a6b98b33..decb74a67 100644 --- a/ui/src/Components/SilenceModal/SilenceMatch/index.tsx +++ b/ui/src/Components/SilenceModal/SilenceMatch/index.tsx @@ -6,7 +6,7 @@ import { observer } from "mobx-react-lite"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faTrash } from "@fortawesome/free-solid-svg-icons/faTrash"; -import { SilenceFormStore, MatcherWithIDT } from "Stores/SilenceFormStore"; +import type { SilenceFormStore, MatcherWithIDT } from "Stores/SilenceFormStore"; import { TooltipWrapper } from "Components/TooltipWrapper"; import { LabelNameInput } from "./LabelNameInput"; import { LabelValueInput } from "./LabelValueInput"; diff --git a/ui/src/Components/SilenceModal/SilenceModalContent.test.tsx b/ui/src/Components/SilenceModal/SilenceModalContent.test.tsx index 6a605bb43..9a3f4deb6 100644 --- a/ui/src/Components/SilenceModal/SilenceModalContent.test.tsx +++ b/ui/src/Components/SilenceModal/SilenceModalContent.test.tsx @@ -8,7 +8,7 @@ import { Settings } from "Stores/Settings"; import { SilenceFormStore } from "Stores/SilenceFormStore"; import { ThemeContext } from "Components/Theme"; import { SilenceModalContent } from "./SilenceModalContent"; -import { APIAlertsResponseUpstreamsT } from "Models/APITypes"; +import type { APIAlertsResponseUpstreamsT } from "Models/APITypes"; let alertStore: AlertStore; let settingsStore: Settings; diff --git a/ui/src/Components/SilenceModal/SilenceModalContent.tsx b/ui/src/Components/SilenceModal/SilenceModalContent.tsx index 3c941660c..f334cdedf 100644 --- a/ui/src/Components/SilenceModal/SilenceModalContent.tsx +++ b/ui/src/Components/SilenceModal/SilenceModalContent.tsx @@ -1,4 +1,4 @@ -import { FC } from "react"; +import type { FC } from "react"; import { Observer } from "mobx-react-lite"; @@ -6,9 +6,9 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faSpinner } from "@fortawesome/free-solid-svg-icons/faSpinner"; import { faLock } from "@fortawesome/free-solid-svg-icons/faLock"; -import { AlertStore } from "Stores/AlertStore"; -import { SilenceFormStore } from "Stores/SilenceFormStore"; -import { Settings } from "Stores/Settings"; +import type { AlertStore } from "Stores/AlertStore"; +import type { SilenceFormStore } from "Stores/SilenceFormStore"; +import type { Settings } from "Stores/Settings"; import { Tab } from "Components/Modal/Tab"; import SilenceForm from "./SilenceForm"; import { SilencePreview } from "./SilencePreview"; diff --git a/ui/src/Components/SilenceModal/SilencePreview/index.tsx b/ui/src/Components/SilenceModal/SilencePreview/index.tsx index 48fe800fb..6045b0321 100644 --- a/ui/src/Components/SilenceModal/SilencePreview/index.tsx +++ b/ui/src/Components/SilenceModal/SilencePreview/index.tsx @@ -1,11 +1,11 @@ -import { FC } from "react"; +import type { FC } from "react"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faArrowLeft } from "@fortawesome/free-solid-svg-icons/faArrowLeft"; import { faCheckCircle } from "@fortawesome/free-solid-svg-icons/faCheckCircle"; -import { AlertStore } from "Stores/AlertStore"; -import { SilenceFormStore } from "Stores/SilenceFormStore"; +import type { AlertStore } from "Stores/AlertStore"; +import type { SilenceFormStore } from "Stores/SilenceFormStore"; import { PaginatedAlertList } from "Components/PaginatedAlertList"; import { MatcherToFilter, AlertManagersToFilter } from "../Matchers"; diff --git a/ui/src/Components/SilenceModal/SilenceSubmit/MultiClusterStatus.tsx b/ui/src/Components/SilenceModal/SilenceSubmit/MultiClusterStatus.tsx index 4a378ee90..75402ea90 100644 --- a/ui/src/Components/SilenceModal/SilenceSubmit/MultiClusterStatus.tsx +++ b/ui/src/Components/SilenceModal/SilenceSubmit/MultiClusterStatus.tsx @@ -1,4 +1,4 @@ -import { FC } from "react"; +import type { FC } from "react"; import { observer } from "mobx-react-lite"; @@ -6,8 +6,8 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faCheckCircle } from "@fortawesome/free-solid-svg-icons/faCheckCircle"; import { faExclamationCircle } from "@fortawesome/free-solid-svg-icons/faExclamationCircle"; -import { AlertStore } from "Stores/AlertStore"; -import { SilenceFormStore } from "Stores/SilenceFormStore"; +import type { AlertStore } from "Stores/AlertStore"; +import type { SilenceFormStore } from "Stores/SilenceFormStore"; import { SilenceSubmitProgress } from "./SilenceSubmitProgress"; const MultiClusterStatus: FC<{ diff --git a/ui/src/Components/SilenceModal/SilenceSubmit/SilenceSubmitController.tsx b/ui/src/Components/SilenceModal/SilenceSubmit/SilenceSubmitController.tsx index 22c4c8ce4..39c564c2f 100644 --- a/ui/src/Components/SilenceModal/SilenceSubmit/SilenceSubmitController.tsx +++ b/ui/src/Components/SilenceModal/SilenceSubmit/SilenceSubmitController.tsx @@ -1,12 +1,12 @@ -import { FC } from "react"; +import type { FC } from "react"; import { observer } from "mobx-react-lite"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faArrowLeft } from "@fortawesome/free-solid-svg-icons/faArrowLeft"; -import { AlertStore } from "Stores/AlertStore"; -import { SilenceFormStore } from "Stores/SilenceFormStore"; +import type { AlertStore } from "Stores/AlertStore"; +import type { SilenceFormStore } from "Stores/SilenceFormStore"; import SingleClusterStatus from "./SingleClusterStatus"; import MultiClusterStatus from "./MultiClusterStatus"; diff --git a/ui/src/Components/SilenceModal/SilenceSubmit/SilenceSubmitProgress.test.tsx b/ui/src/Components/SilenceModal/SilenceSubmit/SilenceSubmitProgress.test.tsx index 3d00fcf73..2e751dad2 100644 --- a/ui/src/Components/SilenceModal/SilenceSubmit/SilenceSubmitProgress.test.tsx +++ b/ui/src/Components/SilenceModal/SilenceSubmit/SilenceSubmitProgress.test.tsx @@ -7,7 +7,7 @@ import fetchMock from "fetch-mock"; import { AlertStore } from "Stores/AlertStore"; import { SilenceFormStore, NewClusterRequest } from "Stores/SilenceFormStore"; import { SilenceSubmitProgress } from "./SilenceSubmitProgress"; -import { APIAlertsResponseUpstreamsT } from "Models/APITypes"; +import type { APIAlertsResponseUpstreamsT } from "Models/APITypes"; let alertStore: AlertStore; let silenceFormStore: SilenceFormStore; diff --git a/ui/src/Components/SilenceModal/SilenceSubmit/SilenceSubmitProgress.tsx b/ui/src/Components/SilenceModal/SilenceSubmit/SilenceSubmitProgress.tsx index de81694f6..467354544 100644 --- a/ui/src/Components/SilenceModal/SilenceSubmit/SilenceSubmitProgress.tsx +++ b/ui/src/Components/SilenceModal/SilenceSubmit/SilenceSubmitProgress.tsx @@ -3,9 +3,9 @@ import { FC, useEffect, useState } from "react"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faCircleNotch } from "@fortawesome/free-solid-svg-icons/faCircleNotch"; -import { AlertmanagerSilencePayloadT } from "Models/APITypes"; -import { AlertStore } from "Stores/AlertStore"; -import { SilenceFormStore } from "Stores/SilenceFormStore"; +import type { AlertmanagerSilencePayloadT } from "Models/APITypes"; +import type { AlertStore } from "Stores/AlertStore"; +import type { SilenceFormStore } from "Stores/SilenceFormStore"; import { useFetchAny, UpstreamT } from "Hooks/useFetchAny"; interface PostResponseT { diff --git a/ui/src/Components/SilenceModal/SilenceSubmit/SingleClusterStatus.tsx b/ui/src/Components/SilenceModal/SilenceSubmit/SingleClusterStatus.tsx index 134842edf..a3db23e37 100644 --- a/ui/src/Components/SilenceModal/SilenceSubmit/SingleClusterStatus.tsx +++ b/ui/src/Components/SilenceModal/SilenceSubmit/SingleClusterStatus.tsx @@ -1,4 +1,4 @@ -import { FC } from "react"; +import type { FC } from "react"; import { observer } from "mobx-react-lite"; @@ -6,8 +6,8 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faCheckCircle } from "@fortawesome/free-solid-svg-icons/faCheckCircle"; import { faExclamationCircle } from "@fortawesome/free-solid-svg-icons/faExclamationCircle"; -import { AlertStore } from "Stores/AlertStore"; -import { SilenceFormStore } from "Stores/SilenceFormStore"; +import type { AlertStore } from "Stores/AlertStore"; +import type { SilenceFormStore } from "Stores/SilenceFormStore"; import { SilenceSubmitProgress } from "./SilenceSubmitProgress"; const SingleClusterStatus: FC<{ diff --git a/ui/src/Components/SilenceModal/index.stories.tsx b/ui/src/Components/SilenceModal/index.stories.tsx index bae6a759a..d46e75fff 100644 --- a/ui/src/Components/SilenceModal/index.stories.tsx +++ b/ui/src/Components/SilenceModal/index.stories.tsx @@ -1,4 +1,4 @@ -import { FC } from "react"; +import type { FC } from "react"; import fetchMock from "fetch-mock"; diff --git a/ui/src/Components/SilenceModal/index.tsx b/ui/src/Components/SilenceModal/index.tsx index a76465898..9b983510c 100644 --- a/ui/src/Components/SilenceModal/index.tsx +++ b/ui/src/Components/SilenceModal/index.tsx @@ -6,9 +6,9 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faBellSlash } from "@fortawesome/free-solid-svg-icons/faBellSlash"; import { faSpinner } from "@fortawesome/free-solid-svg-icons/faSpinner"; -import { AlertStore } from "Stores/AlertStore"; -import { SilenceFormStore } from "Stores/SilenceFormStore"; -import { Settings } from "Stores/Settings"; +import type { AlertStore } from "Stores/AlertStore"; +import type { SilenceFormStore } from "Stores/SilenceFormStore"; +import type { Settings } from "Stores/Settings"; import { Modal } from "Components/Modal"; import { TooltipWrapper } from "Components/TooltipWrapper"; diff --git a/ui/src/Components/Theme/ReactSelect.ts b/ui/src/Components/Theme/ReactSelect.ts index 6f97bd2b0..83e6a3dda 100644 --- a/ui/src/Components/Theme/ReactSelect.ts +++ b/ui/src/Components/Theme/ReactSelect.ts @@ -1,5 +1,5 @@ -import { CSSObject } from "@emotion/serialize"; -import { +import type { CSSObject } from "@emotion/serialize"; +import type { ControlProps, IndicatorContainerProps, OptionTypeBase, diff --git a/ui/src/Components/Theme/index.tsx b/ui/src/Components/Theme/index.tsx index 9868b2579..dd629ab8a 100644 --- a/ui/src/Components/Theme/index.tsx +++ b/ui/src/Components/Theme/index.tsx @@ -4,7 +4,7 @@ import ReactDOM from "react-dom"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faSun } from "@fortawesome/free-solid-svg-icons/faSun"; -import { Styles } from "react-select"; +import type { Styles } from "react-select"; const DarkTheme = React.lazy(() => import("Styles/DarkTheme")); const LightTheme = React.lazy(() => import("Styles/LightTheme")); diff --git a/ui/src/Components/Toast/AppToasts.tsx b/ui/src/Components/Toast/AppToasts.tsx index 3289dc0a8..2de09a53f 100644 --- a/ui/src/Components/Toast/AppToasts.tsx +++ b/ui/src/Components/Toast/AppToasts.tsx @@ -7,7 +7,7 @@ import { faArrowUp } from "@fortawesome/free-solid-svg-icons/faArrowUp"; import { faExclamation } from "@fortawesome/free-solid-svg-icons/faExclamation"; import { faInfoCircle } from "@fortawesome/free-solid-svg-icons/faInfoCircle"; -import { AlertStore } from "Stores/AlertStore"; +import type { AlertStore } from "Stores/AlertStore"; import { TooltipWrapper } from "Components/TooltipWrapper"; import { ToastContainer, Toast } from "."; import { ToastMessage, UpgradeToastMessage } from "./ToastMessages"; diff --git a/ui/src/Components/Toast/ToastMessages.tsx b/ui/src/Components/Toast/ToastMessages.tsx index 19a783898..1604cb725 100644 --- a/ui/src/Components/Toast/ToastMessages.tsx +++ b/ui/src/Components/Toast/ToastMessages.tsx @@ -4,7 +4,7 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faStop } from "@fortawesome/free-solid-svg-icons/faStop"; import { faSync } from "@fortawesome/free-solid-svg-icons/faSync"; -import { AlertStore } from "Stores/AlertStore"; +import type { AlertStore } from "Stores/AlertStore"; const ToastMessage: FC<{ title: ReactNode; diff --git a/ui/src/Components/Toast/index.tsx b/ui/src/Components/Toast/index.tsx index cd8e378bb..df7fac39c 100644 --- a/ui/src/Components/Toast/index.tsx +++ b/ui/src/Components/Toast/index.tsx @@ -4,7 +4,7 @@ import ReactDOM from "react-dom"; import TransitionGroup from "react-transition-group/TransitionGroup"; import { CSSTransition } from "react-transition-group"; -import { IconDefinition } from "@fortawesome/fontawesome-svg-core"; +import type { IconDefinition } from "@fortawesome/fontawesome-svg-core"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faCircle } from "@fortawesome/free-solid-svg-icons/faCircle"; import { faTimes } from "@fortawesome/free-solid-svg-icons/faTimes"; diff --git a/ui/src/Components/ToggleIcon/index.tsx b/ui/src/Components/ToggleIcon/index.tsx index 1f680fd99..dba816073 100644 --- a/ui/src/Components/ToggleIcon/index.tsx +++ b/ui/src/Components/ToggleIcon/index.tsx @@ -1,4 +1,4 @@ -import { FC } from "react"; +import type { FC } from "react"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faChevronDown } from "@fortawesome/free-solid-svg-icons/faChevronDown"; diff --git a/ui/src/Components/ValidationError/index.tsx b/ui/src/Components/ValidationError/index.tsx index 5d68dbc43..4694957af 100644 --- a/ui/src/Components/ValidationError/index.tsx +++ b/ui/src/Components/ValidationError/index.tsx @@ -1,4 +1,4 @@ -import { FC } from "react"; +import type { FC } from "react"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faExclamationCircle } from "@fortawesome/free-solid-svg-icons/faExclamationCircle"; diff --git a/ui/src/Hooks/useFlashTransition.ts b/ui/src/Hooks/useFlashTransition.ts index 09f00e6f4..2e9f8b92f 100644 --- a/ui/src/Hooks/useFlashTransition.ts +++ b/ui/src/Hooks/useFlashTransition.ts @@ -1,6 +1,6 @@ import { useState, useEffect, useRef, ReactNode } from "react"; -import { TransitionProps } from "react-transition-group/Transition"; +import type { TransitionProps } from "react-transition-group/Transition"; import { useInView } from "react-intersection-observer"; diff --git a/ui/src/Hooks/useGrid.test.tsx b/ui/src/Hooks/useGrid.test.tsx index 59c405c91..bcc256237 100644 --- a/ui/src/Hooks/useGrid.test.tsx +++ b/ui/src/Hooks/useGrid.test.tsx @@ -1,4 +1,4 @@ -import { FC, Ref } from "react"; +import type { FC, Ref } from "react"; import { renderHook } from "@testing-library/react-hooks"; diff --git a/ui/src/Stores/AlertStore.ts b/ui/src/Stores/AlertStore.ts index e09826fa5..93c13683e 100644 --- a/ui/src/Stores/AlertStore.ts +++ b/ui/src/Stores/AlertStore.ts @@ -7,7 +7,7 @@ import qs from "qs"; import semverSort from "semver/functions/sort"; import { FetchGet } from "Common/Fetch"; -import { +import type { APIAlertmanagerUpstreamT, APILabelColorT, APIAlertsResponseT, diff --git a/ui/src/Stores/Settings.ts b/ui/src/Stores/Settings.ts index cdc8d6617..208ea13b1 100644 --- a/ui/src/Stores/Settings.ts +++ b/ui/src/Stores/Settings.ts @@ -1,8 +1,8 @@ import { action } from "mobx"; import { localStored } from "mobx-stored"; -import { UIDefaults } from "Models/UI"; -import { OptionT } from "Common/Select"; +import type { UIDefaults } from "Models/UI"; +import type { OptionT } from "Common/Select"; interface SavedFiltersStorage { filters: string[]; diff --git a/ui/src/Stores/SilenceFormStore.ts b/ui/src/Stores/SilenceFormStore.ts index c515b3ffc..396b2f9f3 100644 --- a/ui/src/Stores/SilenceFormStore.ts +++ b/ui/src/Stores/SilenceFormStore.ts @@ -10,7 +10,7 @@ import differenceInDays from "date-fns/differenceInDays"; import differenceInHours from "date-fns/differenceInHours"; import differenceInMinutes from "date-fns/differenceInMinutes"; -import { +import type { APIAlertT, APIAlertGroupT, APIAlertmanagerUpstreamT, @@ -252,7 +252,7 @@ interface SilenceFormStoreDataT { autofillMatchers: boolean; resetInputs: boolean; readonly toBase64: string; - fromBase64: (s: string) => void; + fromBase64: (s: string) => boolean; readonly isValid: boolean; resetStartEnd: () => void; resetProgress: () => void; @@ -372,7 +372,7 @@ class SilenceFormStore { return window.btoa(json); }, - fromBase64(s: string) { + fromBase64(s: string): boolean { let parsed: SilenceFormDataFromBase64; try { parsed = JSON.parse(window.atob(s)); diff --git a/ui/src/Styles/DarkTheme.tsx b/ui/src/Styles/DarkTheme.tsx index e07969cbe..88990c9e1 100644 --- a/ui/src/Styles/DarkTheme.tsx +++ b/ui/src/Styles/DarkTheme.tsx @@ -1,4 +1,4 @@ -import { FC } from "react"; +import type { FC } from "react"; import "./DarkThemeLoader.scss"; diff --git a/ui/src/Styles/LightTheme.tsx b/ui/src/Styles/LightTheme.tsx index c4142b10b..d5e43e410 100644 --- a/ui/src/Styles/LightTheme.tsx +++ b/ui/src/Styles/LightTheme.tsx @@ -1,4 +1,4 @@ -import { FC } from "react"; +import type { FC } from "react"; import "./LightThemeLoader.scss"; diff --git a/ui/src/__fixtures__/AlertHistory.ts b/ui/src/__fixtures__/AlertHistory.ts index 15e943a4b..3f0424c58 100644 --- a/ui/src/__fixtures__/AlertHistory.ts +++ b/ui/src/__fixtures__/AlertHistory.ts @@ -1,4 +1,4 @@ -import { HistoryResponseT } from "Models/APITypes"; +import type { HistoryResponseT } from "Models/APITypes"; export const EmptyHistoryResponse: HistoryResponseT = { error: "", diff --git a/ui/src/__fixtures__/Alerts.ts b/ui/src/__fixtures__/Alerts.ts index 91a64a342..b5ddfb28d 100644 --- a/ui/src/__fixtures__/Alerts.ts +++ b/ui/src/__fixtures__/Alerts.ts @@ -1,4 +1,4 @@ -import { +import type { APIAlertmanagerUpstreamT, APIAlertGroupT, APIAlertT, diff --git a/ui/src/__fixtures__/Defaults.ts b/ui/src/__fixtures__/Defaults.ts index cab47d51e..543b378e4 100644 --- a/ui/src/__fixtures__/Defaults.ts +++ b/ui/src/__fixtures__/Defaults.ts @@ -1,4 +1,4 @@ -import { UIDefaults } from "Models/UI"; +import type { UIDefaults } from "Models/UI"; const DefaultsBase64 = "eyJSZWZyZXNoIjo0NTAwMDAwMDAwMCwiSGlkZUZpbHRlcnNXaGVuSWRsZSI6ZmFsc2UsIkNvbG9yVGl0bGViYXIiOmZhbHNlLCJUaGVtZSI6ImxpZ2h0IiwiQW5pbWF0aW9ucyI6dHJ1ZSwiTWluaW1hbEdyb3VwV2lkdGgiOjU1NSwiQWxlcnRzUGVyR3JvdXAiOjE1LCJDb2xsYXBzZUdyb3VwcyI6ImV4cGFuZGVkIiwiTXVsdGlHcmlkTGFiZWwiOiIiLCJNdWx0aUdyaWRTb3J0UmV2ZXJzZSI6ZmFsc2V9Cg=="; diff --git a/ui/src/__fixtures__/Fetch.ts b/ui/src/__fixtures__/Fetch.ts index f9f36dc68..0a8efb772 100644 --- a/ui/src/__fixtures__/Fetch.ts +++ b/ui/src/__fixtures__/Fetch.ts @@ -1,5 +1,5 @@ import { MockAlert, MockAlertGroup, MockSilence } from "__fixtures__/Alerts"; -import { +import type { APIAlertsResponseT, APILabelCounterT, APIManagedSilenceT, diff --git a/ui/src/__fixtures__/Stories.ts b/ui/src/__fixtures__/Stories.ts index f3a186349..51642437f 100644 --- a/ui/src/__fixtures__/Stories.ts +++ b/ui/src/__fixtures__/Stories.ts @@ -1,7 +1,7 @@ import subMinutes from "date-fns/subMinutes"; -import { AlertStateT, APIAlertGroupT } from "Models/APITypes"; -import { AlertStore } from "Stores/AlertStore"; +import type { AlertStateT, APIAlertGroupT } from "Models/APITypes"; +import type { AlertStore } from "Stores/AlertStore"; import { MockAlert, MockAlertGroup, MockSilence } from "./Alerts"; const MockGroup = ( diff --git a/ui/src/__fixtures__/useFetchGet.ts b/ui/src/__fixtures__/useFetchGet.ts index 6533e61a2..be030d6d8 100644 --- a/ui/src/__fixtures__/useFetchGet.ts +++ b/ui/src/__fixtures__/useFetchGet.ts @@ -1,8 +1,8 @@ import { useState, useEffect, useCallback } from "react"; import { MockAPIResponse, MockSilenceResponse } from "__fixtures__/Fetch"; -import { FetchGetResultT } from "Hooks/useFetchGet"; -import { APIAlertsResponseT, APIManagedSilenceT } from "Models/APITypes"; +import type { FetchGetResultT } from "Hooks/useFetchGet"; +import type { APIAlertsResponseT, APIManagedSilenceT } from "Models/APITypes"; type responseT = null | string[] | APIAlertsResponseT | APIManagedSilenceT[]; diff --git a/ui/tsconfig.json b/ui/tsconfig.json index 2d74f87cb..6115b2c71 100644 --- a/ui/tsconfig.json +++ b/ui/tsconfig.json @@ -2,6 +2,8 @@ "compilerOptions": { "baseUrl": "src", "target": "es5", + "module": "esnext", + "moduleResolution": "node", "lib": ["dom", "dom.iterable", "esnext"], "allowJs": true, "skipLibCheck": true, @@ -9,14 +11,13 @@ "allowSyntheticDefaultImports": true, "strict": true, "forceConsistentCasingInFileNames": true, - "module": "esnext", - "moduleResolution": "node", "resolveJsonModule": true, "isolatedModules": true, "noEmit": true, "jsx": "react-jsx", "noFallthroughCasesInSwitch": true, - "noUnusedLocals": true + "noUnusedLocals": true, + "importsNotUsedAsValues": "error" }, "include": ["src"] }