diff --git a/package.json b/package.json index 77bd6911f..0aaa277de 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,7 @@ "emoji-picker-element": "1.8.2", "emoji-picker-element-data": "1.2.0", "eslint-config-react-app": "6.0.0", - "eslint-plugin-import": "2.24.2", + "eslint-plugin-import": "2.25.2", "eslint-plugin-jsx-a11y": "6.4.1", "eslint-plugin-node": "11.1.0", "eslint-plugin-promise": "5.1.0", @@ -134,7 +134,14 @@ "rules": { "no-use-before-define": "off", "no-debugger": "warn", - "default-param-last": "off" + "default-param-last": "off", + "@typescript-eslint/consistent-type-imports": [ + "error", + { + "prefer": "type-imports", + "disallowTypeAnnotations": false + } + ] }, "plugins": [ "@typescript-eslint" @@ -193,7 +200,6 @@ }, "resolutions": { "cypress": "7.7.0", - "katex": "0.13.18", - "eslint-plugin-import": "2.24.2" + "katex": "0.13.18" } } diff --git a/src/api/config/index.ts b/src/api/config/index.ts index dbe020700..e21e56084 100644 --- a/src/api/config/index.ts +++ b/src/api/config/index.ts @@ -5,7 +5,7 @@ */ import { defaultFetchConfig, expectResponseCode, getApiUrl } from '../utils' -import { Config } from './types' +import type { Config } from './types' export const getConfig = async (): Promise => { const response = await fetch(getApiUrl() + 'config', { diff --git a/src/api/history/dto-methods.ts b/src/api/history/dto-methods.ts index ccdcce30e..cc39de039 100644 --- a/src/api/history/dto-methods.ts +++ b/src/api/history/dto-methods.ts @@ -4,8 +4,9 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { HistoryEntry, HistoryEntryOrigin } from '../../redux/history/types' -import { HistoryEntryDto, HistoryEntryPutDto, HistoryEntryUpdateDto } from './types' +import type { HistoryEntry } from '../../redux/history/types' +import { HistoryEntryOrigin } from '../../redux/history/types' +import type { HistoryEntryDto, HistoryEntryPutDto, HistoryEntryUpdateDto } from './types' export const historyEntryDtoToHistoryEntry = (entryDto: HistoryEntryDto): HistoryEntry => { return { diff --git a/src/api/history/index.ts b/src/api/history/index.ts index 7f6e58a7e..c1fe26860 100644 --- a/src/api/history/index.ts +++ b/src/api/history/index.ts @@ -5,7 +5,7 @@ */ import { defaultFetchConfig, expectResponseCode, getApiUrl } from '../utils' -import { HistoryEntryDto, HistoryEntryPutDto, HistoryEntryUpdateDto } from './types' +import type { HistoryEntryDto, HistoryEntryPutDto, HistoryEntryUpdateDto } from './types' export const getHistory = async (): Promise => { const response = await fetch(getApiUrl() + 'me/history') diff --git a/src/api/me/index.ts b/src/api/me/index.ts index 7085f5b9e..3f29defef 100644 --- a/src/api/me/index.ts +++ b/src/api/me/index.ts @@ -4,7 +4,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { UserResponse } from '../users/types' +import type { UserResponse } from '../users/types' import { defaultFetchConfig, expectResponseCode, getApiUrl } from '../utils' import { isMockMode } from '../../utils/test-modes' diff --git a/src/api/media/index.ts b/src/api/media/index.ts index 69db3d201..696b73ae7 100644 --- a/src/api/media/index.ts +++ b/src/api/media/index.ts @@ -4,7 +4,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { ImageProxyResponse } from '../../components/markdown-renderer/replace-components/image/types' +import type { ImageProxyResponse } from '../../components/markdown-renderer/replace-components/image/types' import { isMockMode } from '../../utils/test-modes' import { defaultFetchConfig, expectResponseCode, getApiUrl } from '../utils' diff --git a/src/api/notes/index.ts b/src/api/notes/index.ts index a348f393e..89454d706 100644 --- a/src/api/notes/index.ts +++ b/src/api/notes/index.ts @@ -5,7 +5,7 @@ */ import { defaultFetchConfig, expectResponseCode, getApiUrl } from '../utils' -import { NoteDto } from './types' +import type { NoteDto } from './types' import { isMockMode } from '../../utils/test-modes' export const getNote = async (noteId: string): Promise => { diff --git a/src/api/notes/types.d.ts b/src/api/notes/types.d.ts index cb22ba96f..e5ae5f8b9 100644 --- a/src/api/notes/types.d.ts +++ b/src/api/notes/types.d.ts @@ -4,8 +4,8 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { UserInfoDto } from '../users/types' -import { GroupInfoDto } from '../group/types' +import type { UserInfoDto } from '../users/types' +import type { GroupInfoDto } from '../group/types' export interface NoteDto { content: string diff --git a/src/api/revisions/index.ts b/src/api/revisions/index.ts index 82d423d8c..425bd83a8 100644 --- a/src/api/revisions/index.ts +++ b/src/api/revisions/index.ts @@ -6,7 +6,7 @@ import { Cache } from '../../components/common/cache/cache' import { defaultFetchConfig, expectResponseCode, getApiUrl } from '../utils' -import { Revision, RevisionListEntry } from './types' +import type { Revision, RevisionListEntry } from './types' const revisionCache = new Cache(3600) diff --git a/src/api/tokens/index.ts b/src/api/tokens/index.ts index 7e54a205d..da097cb83 100644 --- a/src/api/tokens/index.ts +++ b/src/api/tokens/index.ts @@ -5,7 +5,7 @@ */ import { defaultFetchConfig, expectResponseCode, getApiUrl } from '../utils' -import { AccessToken, AccessTokenSecret } from './types' +import type { AccessToken, AccessTokenSecret } from './types' export const getAccessTokenList = async (): Promise => { const response = await fetch(`${getApiUrl()}tokens`, { diff --git a/src/api/users/index.ts b/src/api/users/index.ts index 69316ec67..be61825e7 100644 --- a/src/api/users/index.ts +++ b/src/api/users/index.ts @@ -6,7 +6,7 @@ import { Cache } from '../../components/common/cache/cache' import { defaultFetchConfig, expectResponseCode, getApiUrl } from '../utils' -import { UserResponse } from './types' +import type { UserResponse } from './types' const cache = new Cache(600) diff --git a/src/api/users/types.d.ts b/src/api/users/types.d.ts index 2d5affa6b..0d0ab8882 100644 --- a/src/api/users/types.d.ts +++ b/src/api/users/types.d.ts @@ -4,7 +4,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { LoginProvider } from '../../redux/user/types' +import type { LoginProvider } from '../../redux/user/types' export interface UserResponse { id: string diff --git a/src/components/application-loader/application-loader.tsx b/src/components/application-loader/application-loader.tsx index 8ce323ae7..178fe9b78 100644 --- a/src/components/application-loader/application-loader.tsx +++ b/src/components/application-loader/application-loader.tsx @@ -7,7 +7,8 @@ import React, { Suspense, useCallback, useEffect, useState } from 'react' import { useBackendBaseUrl } from '../../hooks/common/use-backend-base-url' import './application-loader.scss' -import { createSetUpTaskList, InitTask } from './initializers' +import type { InitTask } from './initializers' +import { createSetUpTaskList } from './initializers' import { LoadingScreen } from './loading-screen' import { useCustomizeAssetsUrl } from '../../hooks/common/use-customize-assets-url' import { useFrontendAssetsUrl } from '../../hooks/common/use-frontend-assets-url' diff --git a/src/components/application-loader/initializers/i18n/i18n.ts b/src/components/application-loader/initializers/i18n/i18n.ts index 8574e05f2..f16dc0a7b 100644 --- a/src/components/application-loader/initializers/i18n/i18n.ts +++ b/src/components/application-loader/initializers/i18n/i18n.ts @@ -4,7 +4,8 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import i18n, { ResourceKey } from 'i18next' +import type { ResourceKey } from 'i18next' +import i18n from 'i18next' import LanguageDetector from 'i18next-browser-languagedetector' import resourcesToBackend from 'i18next-resources-to-backend' import { Settings } from 'luxon' diff --git a/src/components/common/copyable/copy-overlay.tsx b/src/components/common/copyable/copy-overlay.tsx index 788ef2300..34fdfcb65 100644 --- a/src/components/common/copyable/copy-overlay.tsx +++ b/src/components/common/copyable/copy-overlay.tsx @@ -4,7 +4,8 @@ SPDX-License-Identifier: AGPL-3.0-only */ -import React, { RefObject, useCallback, useEffect, useState } from 'react' +import type { RefObject } from 'react' +import React, { useCallback, useEffect, useState } from 'react' import { Overlay, Tooltip } from 'react-bootstrap' import { Trans, useTranslation } from 'react-i18next' import { v4 as uuid } from 'uuid' diff --git a/src/components/common/copyable/copy-to-clipboard-button/copy-to-clipboard-button.tsx b/src/components/common/copyable/copy-to-clipboard-button/copy-to-clipboard-button.tsx index bc912b76d..5be24c311 100644 --- a/src/components/common/copyable/copy-to-clipboard-button/copy-to-clipboard-button.tsx +++ b/src/components/common/copyable/copy-to-clipboard-button/copy-to-clipboard-button.tsx @@ -6,7 +6,7 @@ import React, { Fragment, useRef } from 'react' import { Button } from 'react-bootstrap' -import { Variant } from 'react-bootstrap/types' +import type { Variant } from 'react-bootstrap/types' import { useTranslation } from 'react-i18next' import { ForkAwesomeIcon } from '../../fork-awesome/fork-awesome-icon' import { CopyOverlay } from '../copy-overlay' diff --git a/src/components/common/fork-awesome/fork-awesome-icon.tsx b/src/components/common/fork-awesome/fork-awesome-icon.tsx index d336d0f31..ce61acecd 100644 --- a/src/components/common/fork-awesome/fork-awesome-icon.tsx +++ b/src/components/common/fork-awesome/fork-awesome-icon.tsx @@ -5,7 +5,7 @@ */ import React from 'react' -import { IconName, IconSize } from './types' +import type { IconName, IconSize } from './types' export interface ForkAwesomeIconProps { icon: IconName diff --git a/src/components/common/fork-awesome/fork-awesome-stack.tsx b/src/components/common/fork-awesome/fork-awesome-stack.tsx index 563c614d8..1bbb03e7e 100644 --- a/src/components/common/fork-awesome/fork-awesome-stack.tsx +++ b/src/components/common/fork-awesome/fork-awesome-stack.tsx @@ -4,9 +4,11 @@ SPDX-License-Identifier: AGPL-3.0-only */ -import React, { ReactElement } from 'react' -import { ForkAwesomeIcon, ForkAwesomeIconProps } from './fork-awesome-icon' -import { IconSize } from './types' +import type { ReactElement } from 'react' +import React from 'react' +import type { ForkAwesomeIconProps } from './fork-awesome-icon' +import { ForkAwesomeIcon } from './fork-awesome-icon' +import type { IconSize } from './types' export interface ForkAwesomeStackProps { size?: IconSize diff --git a/src/components/common/fork-awesome/types.d.ts b/src/components/common/fork-awesome/types.d.ts index ad3a45c60..d8899cf52 100644 --- a/src/components/common/fork-awesome/types.d.ts +++ b/src/components/common/fork-awesome/types.d.ts @@ -4,7 +4,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { ForkAwesomeIcons } from './fork-awesome-icons' +import type { ForkAwesomeIcons } from './fork-awesome-icons' export type IconName = typeof ForkAwesomeIcons[number] export type IconSize = '2x' | '3x' | '4x' | '5x' diff --git a/src/components/common/icon-button/icon-button.tsx b/src/components/common/icon-button/icon-button.tsx index 4e8631b1c..7637f479b 100644 --- a/src/components/common/icon-button/icon-button.tsx +++ b/src/components/common/icon-button/icon-button.tsx @@ -5,9 +5,10 @@ */ import React from 'react' -import { Button, ButtonProps } from 'react-bootstrap' +import type { ButtonProps } from 'react-bootstrap' +import { Button } from 'react-bootstrap' import { ForkAwesomeIcon } from '../fork-awesome/fork-awesome-icon' -import { IconName } from '../fork-awesome/types' +import type { IconName } from '../fork-awesome/types' import { ShowIf } from '../show-if/show-if' import './icon-button.scss' diff --git a/src/components/common/icon-button/translated-icon-button.tsx b/src/components/common/icon-button/translated-icon-button.tsx index 41675a0f7..eb78876c7 100644 --- a/src/components/common/icon-button/translated-icon-button.tsx +++ b/src/components/common/icon-button/translated-icon-button.tsx @@ -6,7 +6,8 @@ import React from 'react' import { Trans } from 'react-i18next' -import { IconButton, IconButtonProps } from './icon-button' +import type { IconButtonProps } from './icon-button' +import { IconButton } from './icon-button' export interface TranslatedIconButtonProps extends IconButtonProps { i18nKey: string diff --git a/src/components/common/links/external-link.tsx b/src/components/common/links/external-link.tsx index 9c078af59..c308a7433 100644 --- a/src/components/common/links/external-link.tsx +++ b/src/components/common/links/external-link.tsx @@ -6,9 +6,9 @@ import React from 'react' import { ForkAwesomeIcon } from '../fork-awesome/fork-awesome-icon' -import { IconName } from '../fork-awesome/types' +import type { IconName } from '../fork-awesome/types' import { ShowIf } from '../show-if/show-if' -import { LinkWithTextProps } from './types' +import type { LinkWithTextProps } from './types' export const ExternalLink: React.FC = ({ href, diff --git a/src/components/common/links/internal-link.tsx b/src/components/common/links/internal-link.tsx index d0cb16b55..a8b291e4d 100644 --- a/src/components/common/links/internal-link.tsx +++ b/src/components/common/links/internal-link.tsx @@ -7,9 +7,9 @@ import React from 'react' import { Link } from 'react-router-dom' import { ForkAwesomeIcon } from '../fork-awesome/fork-awesome-icon' -import { IconName } from '../fork-awesome/types' +import type { IconName } from '../fork-awesome/types' import { ShowIf } from '../show-if/show-if' -import { LinkWithTextProps } from './types' +import type { LinkWithTextProps } from './types' export const InternalLink: React.FC = ({ href, diff --git a/src/components/common/links/translated-external-link.tsx b/src/components/common/links/translated-external-link.tsx index 7f2910962..6e6044a01 100644 --- a/src/components/common/links/translated-external-link.tsx +++ b/src/components/common/links/translated-external-link.tsx @@ -7,7 +7,7 @@ import React from 'react' import { useTranslation } from 'react-i18next' import { ExternalLink } from './external-link' -import { TranslatedLinkProps } from './types' +import type { TranslatedLinkProps } from './types' export const TranslatedExternalLink: React.FC = ({ i18nKey, i18nOption, ...props }) => { const { t } = useTranslation() diff --git a/src/components/common/links/translated-internal-link.tsx b/src/components/common/links/translated-internal-link.tsx index b79e6fbd8..74fa8183f 100644 --- a/src/components/common/links/translated-internal-link.tsx +++ b/src/components/common/links/translated-internal-link.tsx @@ -7,7 +7,7 @@ import React from 'react' import { useTranslation } from 'react-i18next' import { InternalLink } from './internal-link' -import { TranslatedLinkProps } from './types' +import type { TranslatedLinkProps } from './types' export const TranslatedInternalLink: React.FC = ({ i18nKey, i18nOption, ...props }) => { const { t } = useTranslation() diff --git a/src/components/common/links/types.d.ts b/src/components/common/links/types.d.ts index 436db547e..6a3a97a2b 100644 --- a/src/components/common/links/types.d.ts +++ b/src/components/common/links/types.d.ts @@ -4,8 +4,8 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { StringMap, TOptionsBase } from 'i18next' -import { IconName } from '../fork-awesome/fork-awesome-icon' +import type { StringMap, TOptionsBase } from 'i18next' +import type { IconName } from '../fork-awesome/fork-awesome-icon' interface GeneralLinkProp { href: string diff --git a/src/components/common/modals/common-modal.tsx b/src/components/common/modals/common-modal.tsx index 36ab2c74f..89abeef15 100644 --- a/src/components/common/modals/common-modal.tsx +++ b/src/components/common/modals/common-modal.tsx @@ -8,7 +8,7 @@ import React from 'react' import { Modal } from 'react-bootstrap' import { Trans, useTranslation } from 'react-i18next' import { ForkAwesomeIcon } from '../fork-awesome/fork-awesome-icon' -import { IconName } from '../fork-awesome/types' +import type { IconName } from '../fork-awesome/types' import { ShowIf } from '../show-if/show-if' export interface CommonModalProps { diff --git a/src/components/common/modals/deletion-modal.tsx b/src/components/common/modals/deletion-modal.tsx index 1a68441f8..acfdd4f46 100644 --- a/src/components/common/modals/deletion-modal.tsx +++ b/src/components/common/modals/deletion-modal.tsx @@ -7,7 +7,8 @@ import React from 'react' import { Button, Modal } from 'react-bootstrap' import { Trans, useTranslation } from 'react-i18next' -import { CommonModal, CommonModalProps } from './common-modal' +import type { CommonModalProps } from './common-modal' +import { CommonModal } from './common-modal' export interface DeletionModalProps extends CommonModalProps { onConfirm: () => void diff --git a/src/components/common/modals/error-modal.tsx b/src/components/common/modals/error-modal.tsx index e1b9bb924..e585b81e6 100644 --- a/src/components/common/modals/error-modal.tsx +++ b/src/components/common/modals/error-modal.tsx @@ -6,7 +6,8 @@ import React from 'react' import { Modal } from 'react-bootstrap' -import { CommonModal, CommonModalProps } from './common-modal' +import type { CommonModalProps } from './common-modal' +import { CommonModal } from './common-modal' export const ErrorModal: React.FC = ({ show, onHide, titleI18nKey, icon, children }) => { return ( diff --git a/src/components/common/note-frontmatter/extract-frontmatter.test.ts b/src/components/common/note-frontmatter/extract-frontmatter.test.ts index 2adc9e3db..43bd01278 100644 --- a/src/components/common/note-frontmatter/extract-frontmatter.test.ts +++ b/src/components/common/note-frontmatter/extract-frontmatter.test.ts @@ -5,7 +5,7 @@ */ import { extractFrontmatter } from './extract-frontmatter' -import { PresentFrontmatterExtractionResult } from './types' +import type { PresentFrontmatterExtractionResult } from './types' describe('frontmatter extraction', () => { describe('isPresent property', () => { diff --git a/src/components/common/note-frontmatter/extract-frontmatter.ts b/src/components/common/note-frontmatter/extract-frontmatter.ts index 756a3f0ba..0cc7f4a18 100644 --- a/src/components/common/note-frontmatter/extract-frontmatter.ts +++ b/src/components/common/note-frontmatter/extract-frontmatter.ts @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: AGPL-3.0-only */ -import { FrontmatterExtractionResult } from './types' +import type { FrontmatterExtractionResult } from './types' const FRONTMATTER_BEGIN_REGEX = /^-{3,}$/ const FRONTMATTER_END_REGEX = /^(?:-{3,}|\.{3,})$/ diff --git a/src/components/common/note-frontmatter/note-frontmatter.ts b/src/components/common/note-frontmatter/note-frontmatter.ts index a33c98100..128785d0f 100644 --- a/src/components/common/note-frontmatter/note-frontmatter.ts +++ b/src/components/common/note-frontmatter/note-frontmatter.ts @@ -6,7 +6,8 @@ // import { RevealOptions } from 'reveal.js' import { load } from 'js-yaml' -import { ISO6391, NoteTextDirection, NoteType, RawNoteFrontmatter, SlideOptions } from './types' +import type { RawNoteFrontmatter, SlideOptions } from './types' +import { ISO6391, NoteTextDirection, NoteType } from './types' import { initialSlideOptions } from '../../../redux/note-details/initial-state' /** diff --git a/src/components/common/note-frontmatter/types.ts b/src/components/common/note-frontmatter/types.ts index 1bb0fa3ae..48179225a 100644 --- a/src/components/common/note-frontmatter/types.ts +++ b/src/components/common/note-frontmatter/types.ts @@ -4,7 +4,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { RevealOptions } from 'reveal.js' +import type { RevealOptions } from 'reveal.js' export type FrontmatterExtractionResult = PresentFrontmatterExtractionResult | NonPresentFrontmatterExtractionResult diff --git a/src/components/common/routing/note-direct-link-redirector.tsx b/src/components/common/routing/note-direct-link-redirector.tsx index d7cf5806c..a2f9498bb 100644 --- a/src/components/common/routing/note-direct-link-redirector.tsx +++ b/src/components/common/routing/note-direct-link-redirector.tsx @@ -9,7 +9,7 @@ import { Redirect } from 'react-router' import { useParams } from 'react-router-dom' import { getNote } from '../../../api/notes' import { NotFoundErrorScreen } from './not-found-error-screen' -import { NoteDto } from '../../../api/notes/types' +import type { NoteDto } from '../../../api/notes/types' interface RouteParameters { id: string diff --git a/src/components/document-read-only-page/ErrorWhileLoadingNoteAlert.tsx b/src/components/document-read-only-page/ErrorWhileLoadingNoteAlert.tsx index 4c581cd43..054f5ca49 100644 --- a/src/components/document-read-only-page/ErrorWhileLoadingNoteAlert.tsx +++ b/src/components/document-read-only-page/ErrorWhileLoadingNoteAlert.tsx @@ -8,7 +8,7 @@ import React from 'react' import { Alert } from 'react-bootstrap' import { Trans, useTranslation } from 'react-i18next' import { ShowIf } from '../common/show-if/show-if' -import { SimpleAlertProps } from '../common/simple-alert/simple-alert-props' +import type { SimpleAlertProps } from '../common/simple-alert/simple-alert-props' export const ErrorWhileLoadingNoteAlert: React.FC = ({ show }) => { useTranslation() diff --git a/src/components/document-read-only-page/LoadingNoteAlert.tsx b/src/components/document-read-only-page/LoadingNoteAlert.tsx index 1baed95ff..3092740d8 100644 --- a/src/components/document-read-only-page/LoadingNoteAlert.tsx +++ b/src/components/document-read-only-page/LoadingNoteAlert.tsx @@ -8,7 +8,7 @@ import React from 'react' import { Alert } from 'react-bootstrap' import { Trans } from 'react-i18next' import { ShowIf } from '../common/show-if/show-if' -import { SimpleAlertProps } from '../common/simple-alert/simple-alert-props' +import type { SimpleAlertProps } from '../common/simple-alert/simple-alert-props' export const LoadingNoteAlert: React.FC = ({ show }) => { return ( diff --git a/src/components/document-read-only-page/document-infobar.tsx b/src/components/document-read-only-page/document-infobar.tsx index 0d7bb7e9b..2da6c0eea 100644 --- a/src/components/document-read-only-page/document-infobar.tsx +++ b/src/components/document-read-only-page/document-infobar.tsx @@ -4,7 +4,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { DateTime } from 'luxon' +import type { DateTime } from 'luxon' import React from 'react' import { Trans, useTranslation } from 'react-i18next' import { InternalLink } from '../common/links/internal-link' diff --git a/src/components/editor-page/app-bar/read-only-mode-button.tsx b/src/components/editor-page/app-bar/read-only-mode-button.tsx index bfe3043b4..dd60f87d4 100644 --- a/src/components/editor-page/app-bar/read-only-mode-button.tsx +++ b/src/components/editor-page/app-bar/read-only-mode-button.tsx @@ -10,7 +10,7 @@ import { ForkAwesomeIcon } from '../../common/fork-awesome/fork-awesome-icon' import { Link } from 'react-router-dom' import { useTranslation } from 'react-i18next' import { useParams } from 'react-router' -import { EditorPagePathParams } from '../editor-page' +import type { EditorPagePathParams } from '../editor-page' export const ReadOnlyModeButton: React.FC = () => { const { t } = useTranslation() diff --git a/src/components/editor-page/app-bar/slide-mode-button.tsx b/src/components/editor-page/app-bar/slide-mode-button.tsx index ae822fd75..37fa8882f 100644 --- a/src/components/editor-page/app-bar/slide-mode-button.tsx +++ b/src/components/editor-page/app-bar/slide-mode-button.tsx @@ -10,7 +10,7 @@ import { ForkAwesomeIcon } from '../../common/fork-awesome/fork-awesome-icon' import { Link } from 'react-router-dom' import { useTranslation } from 'react-i18next' import { useParams } from 'react-router' -import { EditorPagePathParams } from '../editor-page' +import type { EditorPagePathParams } from '../editor-page' export const SlideModeButton: React.FC = () => { const { t } = useTranslation() diff --git a/src/components/editor-page/document-bar/document-info/document-info-line-word-count.tsx b/src/components/editor-page/document-bar/document-info/document-info-line-word-count.tsx index ff3ce93e4..e0969061d 100644 --- a/src/components/editor-page/document-bar/document-info/document-info-line-word-count.tsx +++ b/src/components/editor-page/document-bar/document-info/document-info-line-word-count.tsx @@ -10,10 +10,8 @@ import { ShowIf } from '../../../common/show-if/show-if' import { DocumentInfoLine } from './document-info-line' import { UnitalicBoldText } from './unitalic-bold-text' import { useEditorToRendererCommunicator } from '../../render-context/editor-to-renderer-communicator-context-provider' -import { - CommunicationMessageType, - OnWordCountCalculatedMessage -} from '../../../render-page/window-post-message-communicator/rendering-message' +import type { OnWordCountCalculatedMessage } from '../../../render-page/window-post-message-communicator/rendering-message' +import { CommunicationMessageType } from '../../../render-page/window-post-message-communicator/rendering-message' import { useEditorReceiveHandler } from '../../../render-page/window-post-message-communicator/hooks/use-editor-receive-handler' import { useEffectOnRendererReady } from '../../../render-page/window-post-message-communicator/hooks/use-effect-on-renderer-ready' diff --git a/src/components/editor-page/document-bar/document-info/document-info-line.tsx b/src/components/editor-page/document-bar/document-info/document-info-line.tsx index 2e78c495a..d9ed863e5 100644 --- a/src/components/editor-page/document-bar/document-info/document-info-line.tsx +++ b/src/components/editor-page/document-bar/document-info/document-info-line.tsx @@ -6,7 +6,7 @@ import React from 'react' import { ForkAwesomeIcon } from '../../../common/fork-awesome/fork-awesome-icon' -import { IconName } from '../../../common/fork-awesome/types' +import type { IconName } from '../../../common/fork-awesome/types' export interface DocumentInfoLineProps { icon: IconName diff --git a/src/components/editor-page/document-bar/document-info/document-info-time-line.tsx b/src/components/editor-page/document-bar/document-info/document-info-time-line.tsx index 2ba2eb771..36d14206c 100644 --- a/src/components/editor-page/document-bar/document-info/document-info-time-line.tsx +++ b/src/components/editor-page/document-bar/document-info/document-info-time-line.tsx @@ -4,10 +4,10 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { DateTime } from 'luxon' +import type { DateTime } from 'luxon' import React from 'react' import { Trans, useTranslation } from 'react-i18next' -import { IconName } from '../../../common/fork-awesome/types' +import type { IconName } from '../../../common/fork-awesome/types' import { UserAvatar } from '../../../common/user-avatar/user-avatar' import { DocumentInfoLine } from './document-info-line' import { TimeFromNow } from './time-from-now' diff --git a/src/components/editor-page/document-bar/document-info/time-from-now.tsx b/src/components/editor-page/document-bar/document-info/time-from-now.tsx index 742cb50b4..59c213141 100644 --- a/src/components/editor-page/document-bar/document-info/time-from-now.tsx +++ b/src/components/editor-page/document-bar/document-info/time-from-now.tsx @@ -4,7 +4,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { DateTime } from 'luxon' +import type { DateTime } from 'luxon' import React from 'react' diff --git a/src/components/editor-page/document-bar/permissions/permission-list.tsx b/src/components/editor-page/document-bar/permissions/permission-list.tsx index 1509ed2b0..a60c39041 100644 --- a/src/components/editor-page/document-bar/permissions/permission-list.tsx +++ b/src/components/editor-page/document-bar/permissions/permission-list.tsx @@ -4,11 +4,12 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import React, { ReactElement, useState } from 'react' +import type { ReactElement } from 'react' +import React, { useState } from 'react' import { Button, FormControl, InputGroup, ToggleButton, ToggleButtonGroup } from 'react-bootstrap' import { useTranslation } from 'react-i18next' import { ForkAwesomeIcon } from '../../../common/fork-awesome/fork-awesome-icon' -import { Principal } from './permission-modal' +import type { Principal } from './permission-modal' export interface PermissionListProps { list: Principal[] diff --git a/src/components/editor-page/document-bar/permissions/permission-modal.tsx b/src/components/editor-page/document-bar/permissions/permission-modal.tsx index cdccbc7b6..dcfe55a7d 100644 --- a/src/components/editor-page/document-bar/permissions/permission-modal.tsx +++ b/src/components/editor-page/document-bar/permissions/permission-modal.tsx @@ -10,7 +10,8 @@ import { Trans, useTranslation } from 'react-i18next' import { getUserById } from '../../../../api/users' import { CommonModal } from '../../../common/modals/common-modal' import { ShowIf } from '../../../common/show-if/show-if' -import { UserAvatar, UserAvatarProps } from '../../../common/user-avatar/user-avatar' +import type { UserAvatarProps } from '../../../common/user-avatar/user-avatar' +import { UserAvatar } from '../../../common/user-avatar/user-avatar' import { GroupMode, PermissionGroupEntry } from './permission-group-entry' import { PermissionList } from './permission-list' diff --git a/src/components/editor-page/document-bar/revisions/revision-modal-list-entry.tsx b/src/components/editor-page/document-bar/revisions/revision-modal-list-entry.tsx index 50d05beee..50de4abeb 100644 --- a/src/components/editor-page/document-bar/revisions/revision-modal-list-entry.tsx +++ b/src/components/editor-page/document-bar/revisions/revision-modal-list-entry.tsx @@ -8,8 +8,8 @@ import { DateTime } from 'luxon' import React from 'react' import { ListGroup } from 'react-bootstrap' import { Trans } from 'react-i18next' -import { RevisionListEntry } from '../../../../api/revisions/types' -import { UserResponse } from '../../../../api/users/types' +import type { RevisionListEntry } from '../../../../api/revisions/types' +import type { UserResponse } from '../../../../api/users/types' import { ForkAwesomeIcon } from '../../../common/fork-awesome/fork-awesome-icon' import { UserAvatar } from '../../../common/user-avatar/user-avatar' diff --git a/src/components/editor-page/document-bar/revisions/revision-modal.tsx b/src/components/editor-page/document-bar/revisions/revision-modal.tsx index f0ae7a748..1f47bce80 100644 --- a/src/components/editor-page/document-bar/revisions/revision-modal.tsx +++ b/src/components/editor-page/document-bar/revisions/revision-modal.tsx @@ -10,8 +10,8 @@ import ReactDiffViewer, { DiffMethod } from 'react-diff-viewer' import { Trans, useTranslation } from 'react-i18next' import { useParams } from 'react-router' import { getAllRevisions, getRevision } from '../../../../api/revisions' -import { Revision, RevisionListEntry } from '../../../../api/revisions/types' -import { UserResponse } from '../../../../api/users/types' +import type { Revision, RevisionListEntry } from '../../../../api/revisions/types' +import type { UserResponse } from '../../../../api/users/types' import { useIsDarkModeActivated } from '../../../../hooks/common/use-is-dark-mode-activated' import { useNoteMarkdownContent } from '../../../../hooks/common/use-note-markdown-content' import { CommonModal } from '../../../common/modals/common-modal' diff --git a/src/components/editor-page/document-bar/revisions/utils.ts b/src/components/editor-page/document-bar/revisions/utils.ts index a19abd3f3..06ad4b8dc 100644 --- a/src/components/editor-page/document-bar/revisions/utils.ts +++ b/src/components/editor-page/document-bar/revisions/utils.ts @@ -4,9 +4,9 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { Revision } from '../../../../api/revisions/types' +import type { Revision } from '../../../../api/revisions/types' import { getUserById } from '../../../../api/users' -import { UserResponse } from '../../../../api/users/types' +import type { UserResponse } from '../../../../api/users/types' import { download } from '../../../common/download/download' import { Logger } from '../../../../utils/logger' diff --git a/src/components/editor-page/document-bar/share/share-modal.tsx b/src/components/editor-page/document-bar/share/share-modal.tsx index edd87c4fa..233c9be56 100644 --- a/src/components/editor-page/document-bar/share/share-modal.tsx +++ b/src/components/editor-page/document-bar/share/share-modal.tsx @@ -12,7 +12,7 @@ import { useFrontendBaseUrl } from '../../../../hooks/common/use-frontend-base-u import { CopyableField } from '../../../common/copyable/copyable-field/copyable-field' import { CommonModal } from '../../../common/modals/common-modal' import { ShowIf } from '../../../common/show-if/show-if' -import { EditorPagePathParams } from '../../editor-page' +import type { EditorPagePathParams } from '../../editor-page' import { NoteType } from '../../../common/note-frontmatter/types' import { useApplicationState } from '../../../../hooks/common/use-application-state' diff --git a/src/components/editor-page/editor-document-renderer/editor-document-renderer.tsx b/src/components/editor-page/editor-document-renderer/editor-document-renderer.tsx index 2c0e70e5a..06db499a3 100644 --- a/src/components/editor-page/editor-document-renderer/editor-document-renderer.tsx +++ b/src/components/editor-page/editor-document-renderer/editor-document-renderer.tsx @@ -5,7 +5,8 @@ */ import React from 'react' -import { RenderIframe, RenderIframeProps } from '../renderer-pane/render-iframe' +import type { RenderIframeProps } from '../renderer-pane/render-iframe' +import { RenderIframe } from '../renderer-pane/render-iframe' import { useNoteMarkdownContentWithoutFrontmatter } from '../../../hooks/common/use-note-markdown-content-without-frontmatter' import { useSendFrontmatterInfoFromReduxToRenderer } from '../renderer-pane/hooks/use-send-frontmatter-info-from-redux-to-renderer' diff --git a/src/components/editor-page/editor-page.tsx b/src/components/editor-page/editor-page.tsx index 50951cf53..3a926c129 100644 --- a/src/components/editor-page/editor-page.tsx +++ b/src/components/editor-page/editor-page.tsx @@ -20,7 +20,7 @@ import { useLoadNoteFromServer } from './hooks/useLoadNoteFromServer' import { useViewModeShortcuts } from './hooks/useViewModeShortcuts' import { Sidebar } from './sidebar/sidebar' import { Splitter } from './splitter/splitter' -import { DualScrollState, ScrollState } from './synced-scroll/scroll-props' +import type { DualScrollState, ScrollState } from './synced-scroll/scroll-props' import { RendererType } from '../render-page/window-post-message-communicator/rendering-message' import { useEditorModeFromUrl } from './hooks/useEditorModeFromUrl' import { UiNotifications } from '../notifications/ui-notifications' diff --git a/src/components/editor-page/editor-pane/autocompletion/code-block.ts b/src/components/editor-page/editor-pane/autocompletion/code-block.ts index a9418d8f0..c38a1d037 100644 --- a/src/components/editor-page/editor-pane/autocompletion/code-block.ts +++ b/src/components/editor-page/editor-pane/autocompletion/code-block.ts @@ -4,8 +4,10 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { Editor, Hint, Hints, Pos } from 'codemirror' -import { findWordAtCursor, generateHintListByPrefix, Hinter } from './index' +import type { Editor, Hint, Hints } from 'codemirror' +import { Pos } from 'codemirror' +import type { Hinter } from './index' +import { findWordAtCursor, generateHintListByPrefix } from './index' import { showErrorNotification } from '../../../../redux/ui-notifications/methods' import { Logger } from '../../../../utils/logger' diff --git a/src/components/editor-page/editor-pane/autocompletion/collapsable-block.ts b/src/components/editor-page/editor-pane/autocompletion/collapsable-block.ts index 95f6e045e..091548b77 100644 --- a/src/components/editor-page/editor-pane/autocompletion/collapsable-block.ts +++ b/src/components/editor-page/editor-pane/autocompletion/collapsable-block.ts @@ -4,8 +4,10 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { Editor, Hint, Hints, Pos } from 'codemirror' -import { findWordAtCursor, Hinter } from './index' +import type { Editor, Hint, Hints } from 'codemirror' +import { Pos } from 'codemirror' +import type { Hinter } from './index' +import { findWordAtCursor } from './index' const wordRegExp = /^( { const currentLine = editor.getCursor().line diff --git a/src/components/editor-page/editor-pane/tool-bar/utils/emojiUtils.ts b/src/components/editor-page/editor-pane/tool-bar/utils/emojiUtils.ts index 775dd6849..712ddcb55 100644 --- a/src/components/editor-page/editor-pane/tool-bar/utils/emojiUtils.ts +++ b/src/components/editor-page/editor-pane/tool-bar/utils/emojiUtils.ts @@ -4,7 +4,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { EmojiClickEventDetail, NativeEmoji } from 'emoji-picker-element/shared' +import type { EmojiClickEventDetail, NativeEmoji } from 'emoji-picker-element/shared' export const getEmojiIcon = (emoji: EmojiClickEventDetail): string => { if (emoji.unicode) { diff --git a/src/components/editor-page/editor-pane/tool-bar/utils/pasteHandlers.ts b/src/components/editor-page/editor-pane/tool-bar/utils/pasteHandlers.ts index 0f442f783..0121b8351 100644 --- a/src/components/editor-page/editor-pane/tool-bar/utils/pasteHandlers.ts +++ b/src/components/editor-page/editor-pane/tool-bar/utils/pasteHandlers.ts @@ -4,7 +4,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { Editor } from 'codemirror' +import type { Editor } from 'codemirror' import { convertClipboardTableToMarkdown, isTable } from '../../table-extractor' import { handleUpload } from '../../upload-handler' import { insertAtCursor } from './toolbarButtonUtils' diff --git a/src/components/editor-page/editor-pane/tool-bar/utils/toolbarButtonUtils.test.ts b/src/components/editor-page/editor-pane/tool-bar/utils/toolbarButtonUtils.test.ts index 1573ea6a0..e9f65f513 100644 --- a/src/components/editor-page/editor-pane/tool-bar/utils/toolbarButtonUtils.test.ts +++ b/src/components/editor-page/editor-pane/tool-bar/utils/toolbarButtonUtils.test.ts @@ -4,8 +4,9 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import CodeMirror, { Editor, Position, Range } from 'codemirror' -import { EmojiClickEventDetail } from 'emoji-picker-element/shared' +import type { Editor, Position, Range } from 'codemirror' +import type CodeMirror from 'codemirror' +import type { EmojiClickEventDetail } from 'emoji-picker-element/shared' import { Mock } from 'ts-mockery' import { addCodeFences, diff --git a/src/components/editor-page/editor-pane/tool-bar/utils/toolbarButtonUtils.ts b/src/components/editor-page/editor-pane/tool-bar/utils/toolbarButtonUtils.ts index e1b041c20..56958c60b 100644 --- a/src/components/editor-page/editor-pane/tool-bar/utils/toolbarButtonUtils.ts +++ b/src/components/editor-page/editor-pane/tool-bar/utils/toolbarButtonUtils.ts @@ -4,8 +4,8 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { Editor } from 'codemirror' -import { EmojiClickEventDetail } from 'emoji-picker-element/shared' +import type { Editor } from 'codemirror' +import type { EmojiClickEventDetail } from 'emoji-picker-element/shared' import { createNumberRangeArray } from '../../../../common/number-range/number-range' import { getEmojiShortCode } from './emojiUtils' diff --git a/src/components/editor-page/editor-pane/upload-handler.ts b/src/components/editor-page/editor-pane/upload-handler.ts index 27a09f86d..a9f90da5d 100644 --- a/src/components/editor-page/editor-pane/upload-handler.ts +++ b/src/components/editor-page/editor-pane/upload-handler.ts @@ -4,7 +4,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { Editor } from 'codemirror' +import type { Editor } from 'codemirror' import i18n from 'i18next' import { uploadFile } from '../../../api/media' import { store } from '../../../redux' diff --git a/src/components/editor-page/hooks/useLoadNoteFromServer.ts b/src/components/editor-page/hooks/useLoadNoteFromServer.ts index a1612ef1a..56c195a4b 100644 --- a/src/components/editor-page/hooks/useLoadNoteFromServer.ts +++ b/src/components/editor-page/hooks/useLoadNoteFromServer.ts @@ -8,7 +8,7 @@ import { useEffect, useState } from 'react' import { useParams } from 'react-router' import { getNote } from '../../../api/notes' import { setNoteDataFromServer } from '../../../redux/note-details/methods' -import { EditorPagePathParams } from '../editor-page' +import type { EditorPagePathParams } from '../editor-page' import { Logger } from '../../../utils/logger' const log = new Logger('Load Note From Server') diff --git a/src/components/editor-page/hooks/useUpdateLocalHistoryEntry.ts b/src/components/editor-page/hooks/useUpdateLocalHistoryEntry.ts index a545a06de..264f7c83f 100644 --- a/src/components/editor-page/hooks/useUpdateLocalHistoryEntry.ts +++ b/src/components/editor-page/hooks/useUpdateLocalHistoryEntry.ts @@ -8,8 +8,9 @@ import equal from 'fast-deep-equal' import { useEffect, useRef } from 'react' import { store } from '../../../redux' import { useParams } from 'react-router-dom' -import { EditorPagePathParams } from '../editor-page' -import { HistoryEntry, HistoryEntryOrigin } from '../../../redux/history/types' +import type { EditorPagePathParams } from '../editor-page' +import type { HistoryEntry } from '../../../redux/history/types' +import { HistoryEntryOrigin } from '../../../redux/history/types' import { updateLocalHistoryEntry } from '../../../redux/history/methods' import { useApplicationState } from '../../../hooks/common/use-application-state' diff --git a/src/components/editor-page/render-context/renderer-to-editor-communicator-context-provider.tsx b/src/components/editor-page/render-context/renderer-to-editor-communicator-context-provider.tsx index 7199e0a45..062c7ec2b 100644 --- a/src/components/editor-page/render-context/renderer-to-editor-communicator-context-provider.tsx +++ b/src/components/editor-page/render-context/renderer-to-editor-communicator-context-provider.tsx @@ -6,7 +6,7 @@ import React, { createContext, useContext, useEffect, useMemo } from 'react' import { useSelector } from 'react-redux' -import { ApplicationState } from '../../../redux' +import type { ApplicationState } from '../../../redux' import { RendererToEditorCommunicator } from '../../render-page/window-post-message-communicator/renderer-to-editor-communicator' import { CommunicationMessageType } from '../../render-page/window-post-message-communicator/rendering-message' diff --git a/src/components/editor-page/renderer-pane/communicator-image-lightbox.tsx b/src/components/editor-page/renderer-pane/communicator-image-lightbox.tsx index d6e79fd30..2844fd2ac 100644 --- a/src/components/editor-page/renderer-pane/communicator-image-lightbox.tsx +++ b/src/components/editor-page/renderer-pane/communicator-image-lightbox.tsx @@ -6,11 +6,11 @@ import React, { useCallback, useState } from 'react' import { ImageLightboxModal } from '../../markdown-renderer/replace-components/image/image-lightbox-modal' -import { - CommunicationMessageType, +import type { ImageClickedMessage, ImageDetails } from '../../render-page/window-post-message-communicator/rendering-message' +import { CommunicationMessageType } from '../../render-page/window-post-message-communicator/rendering-message' import { useEditorReceiveHandler } from '../../render-page/window-post-message-communicator/hooks/use-editor-receive-handler' export const CommunicatorImageLightbox: React.FC = () => { diff --git a/src/components/editor-page/renderer-pane/hooks/use-effect-on-render-type-change.ts b/src/components/editor-page/renderer-pane/hooks/use-effect-on-render-type-change.ts index 7531be8ac..a011afb8a 100644 --- a/src/components/editor-page/renderer-pane/hooks/use-effect-on-render-type-change.ts +++ b/src/components/editor-page/renderer-pane/hooks/use-effect-on-render-type-change.ts @@ -5,7 +5,7 @@ */ import { useEffect, useRef } from 'react' -import { RendererType } from '../../../render-page/window-post-message-communicator/rendering-message' +import type { RendererType } from '../../../render-page/window-post-message-communicator/rendering-message' /** * Execute the given reload callback if the given render type changes. diff --git a/src/components/editor-page/renderer-pane/hooks/use-force-render-page-url-on-iframe-load-callback.ts b/src/components/editor-page/renderer-pane/hooks/use-force-render-page-url-on-iframe-load-callback.ts index 0d90c16c6..4e7e8a055 100644 --- a/src/components/editor-page/renderer-pane/hooks/use-force-render-page-url-on-iframe-load-callback.ts +++ b/src/components/editor-page/renderer-pane/hooks/use-force-render-page-url-on-iframe-load-callback.ts @@ -4,7 +4,8 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { RefObject, useCallback, useEffect, useMemo, useRef } from 'react' +import type { RefObject } from 'react' +import { useCallback, useEffect, useMemo, useRef } from 'react' import { Logger } from '../../../../utils/logger' const log = new Logger('IframeLoader') diff --git a/src/components/editor-page/renderer-pane/hooks/use-send-frontmatter-info-from-redux-to-renderer.ts b/src/components/editor-page/renderer-pane/hooks/use-send-frontmatter-info-from-redux-to-renderer.ts index 152e4d110..ce0c044c9 100644 --- a/src/components/editor-page/renderer-pane/hooks/use-send-frontmatter-info-from-redux-to-renderer.ts +++ b/src/components/editor-page/renderer-pane/hooks/use-send-frontmatter-info-from-redux-to-renderer.ts @@ -8,7 +8,7 @@ import { useSendToRenderer } from '../../../render-page/window-post-message-comm import { useMemo, useRef } from 'react' import { CommunicationMessageType } from '../../../render-page/window-post-message-communicator/rendering-message' import { useApplicationState } from '../../../../hooks/common/use-application-state' -import { RendererFrontmatterInfo } from '../../../common/note-frontmatter/types' +import type { RendererFrontmatterInfo } from '../../../common/note-frontmatter/types' import equal from 'fast-deep-equal' /** diff --git a/src/components/editor-page/renderer-pane/hooks/use-send-scroll-state.ts b/src/components/editor-page/renderer-pane/hooks/use-send-scroll-state.ts index bed102538..10af86ae8 100644 --- a/src/components/editor-page/renderer-pane/hooks/use-send-scroll-state.ts +++ b/src/components/editor-page/renderer-pane/hooks/use-send-scroll-state.ts @@ -5,7 +5,7 @@ */ import { useCallback, useRef } from 'react' -import { ScrollState } from '../../synced-scroll/scroll-props' +import type { ScrollState } from '../../synced-scroll/scroll-props' import { CommunicationMessageType } from '../../../render-page/window-post-message-communicator/rendering-message' import { useEffectOnRendererReady } from '../../../render-page/window-post-message-communicator/hooks/use-effect-on-renderer-ready' import equal from 'fast-deep-equal' diff --git a/src/components/editor-page/renderer-pane/render-iframe.tsx b/src/components/editor-page/renderer-pane/render-iframe.tsx index 4ff612168..92e4276cc 100644 --- a/src/components/editor-page/renderer-pane/render-iframe.tsx +++ b/src/components/editor-page/renderer-pane/render-iframe.tsx @@ -5,15 +5,15 @@ */ import React, { Fragment, useCallback, useEffect, useRef, useState } from 'react' import { isTestMode } from '../../../utils/test-modes' -import { RendererProps } from '../../render-page/markdown-document' -import { - CommunicationMessageType, +import type { RendererProps } from '../../render-page/markdown-document' +import type { OnFirstHeadingChangeMessage, OnHeightChangeMessage, OnTaskCheckboxChangeMessage, RendererType, SetScrollStateMessage } from '../../render-page/window-post-message-communicator/rendering-message' +import { CommunicationMessageType } from '../../render-page/window-post-message-communicator/rendering-message' import { useEditorToRendererCommunicator } from '../render-context/editor-to-renderer-communicator-context-provider' import { useForceRenderPageUrlOnIframeLoadCallback } from './hooks/use-force-render-page-url-on-iframe-load-callback' import { CommunicatorImageLightbox } from './communicator-image-lightbox' diff --git a/src/components/editor-page/renderer-pane/yaml-array-deprecation-alert.tsx b/src/components/editor-page/renderer-pane/yaml-array-deprecation-alert.tsx index 9aefd1bf4..67cc4a99a 100644 --- a/src/components/editor-page/renderer-pane/yaml-array-deprecation-alert.tsx +++ b/src/components/editor-page/renderer-pane/yaml-array-deprecation-alert.tsx @@ -10,7 +10,7 @@ import { Trans, useTranslation } from 'react-i18next' import links from '../../../links.json' import { TranslatedExternalLink } from '../../common/links/translated-external-link' import { ShowIf } from '../../common/show-if/show-if' -import { CommonModalProps } from '../../common/modals/common-modal' +import type { CommonModalProps } from '../../common/modals/common-modal' export const YamlArrayDeprecationAlert: React.FC> = ({ show }) => { useTranslation() diff --git a/src/components/editor-page/sidebar/delete-note-sidebar-entry.tsx b/src/components/editor-page/sidebar/delete-note-sidebar-entry.tsx index cb0025e97..c6d6de29c 100644 --- a/src/components/editor-page/sidebar/delete-note-sidebar-entry.tsx +++ b/src/components/editor-page/sidebar/delete-note-sidebar-entry.tsx @@ -8,7 +8,7 @@ import React, { Fragment, useState } from 'react' import { Trans, useTranslation } from 'react-i18next' import { DeletionModal } from '../../common/modals/deletion-modal' import { SidebarButton } from './sidebar-button' -import { SpecificSidebarEntryProps } from './types' +import type { SpecificSidebarEntryProps } from './types' export const DeleteNoteSidebarEntry: React.FC = ({ hide, className }) => { useTranslation() diff --git a/src/components/editor-page/sidebar/document-info-sidebar-entry.tsx b/src/components/editor-page/sidebar/document-info-sidebar-entry.tsx index 51cf5091c..ab6521068 100644 --- a/src/components/editor-page/sidebar/document-info-sidebar-entry.tsx +++ b/src/components/editor-page/sidebar/document-info-sidebar-entry.tsx @@ -8,7 +8,7 @@ import React, { Fragment, useState } from 'react' import { Trans, useTranslation } from 'react-i18next' import { DocumentInfoModal } from '../document-bar/document-info/document-info-modal' import { SidebarButton } from './sidebar-button' -import { SpecificSidebarEntryProps } from './types' +import type { SpecificSidebarEntryProps } from './types' export const DocumentInfoSidebarEntry: React.FC = ({ className, hide }) => { const [showModal, setShowModal] = useState(false) diff --git a/src/components/editor-page/sidebar/export-menu-sidebar-menu.tsx b/src/components/editor-page/sidebar/export-menu-sidebar-menu.tsx index 3360b8198..49f6bf38f 100644 --- a/src/components/editor-page/sidebar/export-menu-sidebar-menu.tsx +++ b/src/components/editor-page/sidebar/export-menu-sidebar-menu.tsx @@ -10,7 +10,8 @@ import links from '../../../links.json' import { ExportMarkdownSidebarEntry } from './export-markdown-sidebar-entry' import { SidebarButton } from './sidebar-button' import { SidebarMenu } from './sidebar-menu' -import { DocumentSidebarMenuSelection, SpecificSidebarMenuProps } from './types' +import type { SpecificSidebarMenuProps } from './types' +import { DocumentSidebarMenuSelection } from './types' export const ExportMenuSidebarMenu: React.FC = ({ className, diff --git a/src/components/editor-page/sidebar/import-menu-sidebar-menu.tsx b/src/components/editor-page/sidebar/import-menu-sidebar-menu.tsx index df22456be..8de86acbf 100644 --- a/src/components/editor-page/sidebar/import-menu-sidebar-menu.tsx +++ b/src/components/editor-page/sidebar/import-menu-sidebar-menu.tsx @@ -9,7 +9,8 @@ import { Trans, useTranslation } from 'react-i18next' import { ImportMarkdownSidebarEntry } from './import-markdown-sidebar-entry' import { SidebarButton } from './sidebar-button' import { SidebarMenu } from './sidebar-menu' -import { DocumentSidebarMenuSelection, SpecificSidebarMenuProps } from './types' +import type { SpecificSidebarMenuProps } from './types' +import { DocumentSidebarMenuSelection } from './types' export const ImportMenuSidebarMenu: React.FC = ({ className, diff --git a/src/components/editor-page/sidebar/permissions-sidebar-entry.tsx b/src/components/editor-page/sidebar/permissions-sidebar-entry.tsx index db12b0dac..ce007054d 100644 --- a/src/components/editor-page/sidebar/permissions-sidebar-entry.tsx +++ b/src/components/editor-page/sidebar/permissions-sidebar-entry.tsx @@ -8,7 +8,7 @@ import React, { Fragment, useState } from 'react' import { Trans, useTranslation } from 'react-i18next' import { PermissionModal } from '../document-bar/permissions/permission-modal' import { SidebarButton } from './sidebar-button' -import { SpecificSidebarEntryProps } from './types' +import type { SpecificSidebarEntryProps } from './types' export const PermissionsSidebarEntry: React.FC = ({ className, hide }) => { const [showModal, setShowModal] = useState(false) diff --git a/src/components/editor-page/sidebar/pin-note-sidebar-entry.tsx b/src/components/editor-page/sidebar/pin-note-sidebar-entry.tsx index 110ae667c..c76a20c95 100644 --- a/src/components/editor-page/sidebar/pin-note-sidebar-entry.tsx +++ b/src/components/editor-page/sidebar/pin-note-sidebar-entry.tsx @@ -7,9 +7,9 @@ import React, { useCallback, useMemo } from 'react' import { Trans, useTranslation } from 'react-i18next' import { SidebarButton } from './sidebar-button' -import { SpecificSidebarEntryProps } from './types' +import type { SpecificSidebarEntryProps } from './types' import { useParams } from 'react-router-dom' -import { EditorPagePathParams } from '../editor-page' +import type { EditorPagePathParams } from '../editor-page' import { toggleHistoryEntryPinning } from '../../../redux/history/methods' import { showErrorNotification } from '../../../redux/ui-notifications/methods' import { useApplicationState } from '../../../hooks/common/use-application-state' diff --git a/src/components/editor-page/sidebar/revision-sidebar-entry.tsx b/src/components/editor-page/sidebar/revision-sidebar-entry.tsx index dd739fe65..297b57fc2 100644 --- a/src/components/editor-page/sidebar/revision-sidebar-entry.tsx +++ b/src/components/editor-page/sidebar/revision-sidebar-entry.tsx @@ -8,7 +8,7 @@ import React, { Fragment, useState } from 'react' import { Trans } from 'react-i18next' import { RevisionModal } from '../document-bar/revisions/revision-modal' import { SidebarButton } from './sidebar-button' -import { SpecificSidebarEntryProps } from './types' +import type { SpecificSidebarEntryProps } from './types' export const RevisionSidebarEntry: React.FC = ({ className, hide }) => { const [showModal, setShowModal] = useState(false) diff --git a/src/components/editor-page/sidebar/share-sidebar-entry.tsx b/src/components/editor-page/sidebar/share-sidebar-entry.tsx index 0d5edb494..1677841b0 100644 --- a/src/components/editor-page/sidebar/share-sidebar-entry.tsx +++ b/src/components/editor-page/sidebar/share-sidebar-entry.tsx @@ -8,7 +8,7 @@ import React, { Fragment, useState } from 'react' import { Trans, useTranslation } from 'react-i18next' import { ShareModal } from '../document-bar/share/share-modal' import { SidebarButton } from './sidebar-button' -import { SpecificSidebarEntryProps } from './types' +import type { SpecificSidebarEntryProps } from './types' export const ShareSidebarEntry: React.FC = ({ className, hide }) => { const [showModal, setShowModal] = useState(false) diff --git a/src/components/editor-page/sidebar/sidebar-button.tsx b/src/components/editor-page/sidebar/sidebar-button.tsx index 282b7a2d2..caa3b4ee9 100644 --- a/src/components/editor-page/sidebar/sidebar-button.tsx +++ b/src/components/editor-page/sidebar/sidebar-button.tsx @@ -6,9 +6,9 @@ import React from 'react' import { ForkAwesomeIcon } from '../../common/fork-awesome/fork-awesome-icon' -import { IconName } from '../../common/fork-awesome/types' +import type { IconName } from '../../common/fork-awesome/types' import { ShowIf } from '../../common/show-if/show-if' -import { SidebarEntryProps } from './types' +import type { SidebarEntryProps } from './types' export type SidebarEntryVariant = 'primary' diff --git a/src/components/editor-page/sidebar/sidebar-menu.tsx b/src/components/editor-page/sidebar/sidebar-menu.tsx index b0c2ae520..4045b16c4 100644 --- a/src/components/editor-page/sidebar/sidebar-menu.tsx +++ b/src/components/editor-page/sidebar/sidebar-menu.tsx @@ -5,7 +5,7 @@ */ import React from 'react' -import { SidebarMenuProps } from './types' +import type { SidebarMenuProps } from './types' export const SidebarMenu: React.FC = ({ children, expand }) => { return ( diff --git a/src/components/editor-page/sidebar/types.ts b/src/components/editor-page/sidebar/types.ts index f7ab7f986..2c23bdd3c 100644 --- a/src/components/editor-page/sidebar/types.ts +++ b/src/components/editor-page/sidebar/types.ts @@ -4,9 +4,9 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { RefObject } from 'react' -import { IconName } from '../../common/fork-awesome/types' -import { SidebarEntryVariant } from './sidebar-button' +import type { RefObject } from 'react' +import type { IconName } from '../../common/fork-awesome/types' +import type { SidebarEntryVariant } from './sidebar-button' export interface SpecificSidebarEntryProps { className?: string diff --git a/src/components/editor-page/sidebar/upload-input.tsx b/src/components/editor-page/sidebar/upload-input.tsx index b16a4ff10..ba4a1e775 100644 --- a/src/components/editor-page/sidebar/upload-input.tsx +++ b/src/components/editor-page/sidebar/upload-input.tsx @@ -4,7 +4,8 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import React, { MutableRefObject, useCallback, useEffect, useRef } from 'react' +import type { MutableRefObject } from 'react' +import React, { useCallback, useEffect, useRef } from 'react' import { Logger } from '../../../utils/logger' const log = new Logger('UploadInput') diff --git a/src/components/editor-page/sidebar/users-online-sidebar-menu/user-line.tsx b/src/components/editor-page/sidebar/users-online-sidebar-menu/user-line.tsx index 1f6f57411..9aaf69759 100644 --- a/src/components/editor-page/sidebar/users-online-sidebar-menu/user-line.tsx +++ b/src/components/editor-page/sidebar/users-online-sidebar-menu/user-line.tsx @@ -6,7 +6,8 @@ import React from 'react' import { UserAvatar } from '../../../common/user-avatar/user-avatar' -import { ActiveIndicator, ActiveIndicatorStatus } from './active-indicator' +import type { ActiveIndicatorStatus } from './active-indicator' +import { ActiveIndicator } from './active-indicator' import './user-line.scss' export interface UserLineProps { diff --git a/src/components/editor-page/sidebar/users-online-sidebar-menu/users-online-sidebar-menu.tsx b/src/components/editor-page/sidebar/users-online-sidebar-menu/users-online-sidebar-menu.tsx index 8d9c5ac3b..928acf1ce 100644 --- a/src/components/editor-page/sidebar/users-online-sidebar-menu/users-online-sidebar-menu.tsx +++ b/src/components/editor-page/sidebar/users-online-sidebar-menu/users-online-sidebar-menu.tsx @@ -8,7 +8,8 @@ import React, { Fragment, useCallback, useEffect, useRef, useState } from 'react import { Trans, useTranslation } from 'react-i18next' import { SidebarButton } from '../sidebar-button' import { SidebarMenu } from '../sidebar-menu' -import { DocumentSidebarMenuSelection, SpecificSidebarMenuProps } from '../types' +import type { SpecificSidebarMenuProps } from '../types' +import { DocumentSidebarMenuSelection } from '../types' import { ActiveIndicatorStatus } from './active-indicator' import './online-counter.scss' import { UserLine } from './user-line' diff --git a/src/components/editor-page/splitter/splitter.tsx b/src/components/editor-page/splitter/splitter.tsx index c277d03bd..eb3626272 100644 --- a/src/components/editor-page/splitter/splitter.tsx +++ b/src/components/editor-page/splitter/splitter.tsx @@ -4,7 +4,8 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import React, { ReactElement, useCallback, useEffect, useRef, useState } from 'react' +import type { ReactElement } from 'react' +import React, { useCallback, useEffect, useRef, useState } from 'react' import { ShowIf } from '../../common/show-if/show-if' import { SplitDivider } from './split-divider/split-divider' import './splitter.scss' diff --git a/src/components/editor-page/synced-scroll/utils.ts b/src/components/editor-page/synced-scroll/utils.ts index 6952b918d..0da7bafec 100644 --- a/src/components/editor-page/synced-scroll/utils.ts +++ b/src/components/editor-page/synced-scroll/utils.ts @@ -4,7 +4,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { LineMarkerPosition } from '../../markdown-renderer/types' +import type { LineMarkerPosition } from '../../markdown-renderer/types' export const findLineMarks = ( lineMarks: LineMarkerPosition[], diff --git a/src/components/editor-page/table-of-contents/build-react-dom-from-toc-ast.tsx b/src/components/editor-page/table-of-contents/build-react-dom-from-toc-ast.tsx index 41584c743..fe681606f 100644 --- a/src/components/editor-page/table-of-contents/build-react-dom-from-toc-ast.tsx +++ b/src/components/editor-page/table-of-contents/build-react-dom-from-toc-ast.tsx @@ -4,8 +4,9 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { TocAst } from 'markdown-it-toc-done-right' -import React, { Fragment, ReactElement } from 'react' +import type { TocAst } from 'markdown-it-toc-done-right' +import type { ReactElement } from 'react' +import React, { Fragment } from 'react' import { ShowIf } from '../../common/show-if/show-if' import { createJumpToMarkClickEventHandler } from '../../markdown-renderer/replace-components/link-replacer/link-replacer' import { tocSlugify } from './toc-slugify' diff --git a/src/components/editor-page/table-of-contents/table-of-contents.tsx b/src/components/editor-page/table-of-contents/table-of-contents.tsx index 7f2057b9e..9248b2153 100644 --- a/src/components/editor-page/table-of-contents/table-of-contents.tsx +++ b/src/components/editor-page/table-of-contents/table-of-contents.tsx @@ -4,7 +4,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { TocAst } from 'markdown-it-toc-done-right' +import type { TocAst } from 'markdown-it-toc-done-right' import React, { useMemo } from 'react' import { Trans, useTranslation } from 'react-i18next' import { ShowIf } from '../../common/show-if/show-if' diff --git a/src/components/error-boundary/error-boundary.tsx b/src/components/error-boundary/error-boundary.tsx index 2a96f4c8b..becc3aa1d 100644 --- a/src/components/error-boundary/error-boundary.tsx +++ b/src/components/error-boundary/error-boundary.tsx @@ -4,7 +4,8 @@ SPDX-License-Identifier: AGPL-3.0-only */ -import React, { Component, ErrorInfo, ReactElement, ReactNodeArray } from 'react' +import type { ErrorInfo, ReactElement, ReactNodeArray } from 'react' +import React, { Component } from 'react' import { Button, Container } from 'react-bootstrap' import links from '../../links.json' import frontendVersion from '../../version.json' diff --git a/src/components/history-page/entry-menu/dropdown-item-with-deletion-modal.tsx b/src/components/history-page/entry-menu/dropdown-item-with-deletion-modal.tsx index 1f888310c..2cfe35b76 100644 --- a/src/components/history-page/entry-menu/dropdown-item-with-deletion-modal.tsx +++ b/src/components/history-page/entry-menu/dropdown-item-with-deletion-modal.tsx @@ -8,7 +8,7 @@ import React, { Fragment, useState } from 'react' import { Dropdown } from 'react-bootstrap' import { Trans, useTranslation } from 'react-i18next' import { ForkAwesomeIcon } from '../../common/fork-awesome/fork-awesome-icon' -import { IconName } from '../../common/fork-awesome/types' +import type { IconName } from '../../common/fork-awesome/types' import { DeletionModal } from '../../common/modals/deletion-modal' export interface DropdownItemWithDeletionModalProps { diff --git a/src/components/history-page/history-card/history-card-list.tsx b/src/components/history-page/history-card/history-card-list.tsx index f7a32ace7..b23a5af5d 100644 --- a/src/components/history-page/history-card/history-card-list.tsx +++ b/src/components/history-page/history-card/history-card-list.tsx @@ -7,7 +7,7 @@ import React from 'react' import { Row } from 'react-bootstrap' import { Pager } from '../../common/pagination/pager' -import { HistoryEntriesProps, HistoryEventHandlers } from '../history-content/history-content' +import type { HistoryEntriesProps, HistoryEventHandlers } from '../history-content/history-content' import { HistoryCard } from './history-card' export const HistoryCardList: React.FC = ({ diff --git a/src/components/history-page/history-card/history-card.tsx b/src/components/history-page/history-card/history-card.tsx index 5d33f5caa..e44902b62 100644 --- a/src/components/history-page/history-card/history-card.tsx +++ b/src/components/history-page/history-card/history-card.tsx @@ -10,7 +10,7 @@ import { Badge, Card } from 'react-bootstrap' import { Link } from 'react-router-dom' import { ForkAwesomeIcon } from '../../common/fork-awesome/fork-awesome-icon' import { EntryMenu } from '../entry-menu/entry-menu' -import { HistoryEntryProps, HistoryEventHandlers } from '../history-content/history-content' +import type { HistoryEntryProps, HistoryEventHandlers } from '../history-content/history-content' import { PinButton } from '../pin-button/pin-button' import { formatHistoryDate } from '../utils' import './history-card.scss' diff --git a/src/components/history-page/history-content/history-content.tsx b/src/components/history-page/history-content/history-content.tsx index b670a054f..a6e99d56d 100644 --- a/src/components/history-page/history-content/history-content.tsx +++ b/src/components/history-page/history-content/history-content.tsx @@ -11,7 +11,7 @@ import { PagerPagination } from '../../common/pagination/pager-pagination' import { HistoryCardList } from '../history-card/history-card-list' import { HistoryTable } from '../history-table/history-table' import { ViewStateEnum } from '../history-toolbar/history-toolbar' -import { HistoryEntry } from '../../../redux/history/types' +import type { HistoryEntry } from '../../../redux/history/types' import { removeHistoryEntry, toggleHistoryEntryPinning } from '../../../redux/history/methods' import { deleteNote } from '../../../api/notes' import { showErrorNotification } from '../../../redux/ui-notifications/methods' diff --git a/src/components/history-page/history-page.tsx b/src/components/history-page/history-page.tsx index d614130bc..2365c8a92 100644 --- a/src/components/history-page/history-page.tsx +++ b/src/components/history-page/history-page.tsx @@ -8,10 +8,11 @@ import React, { Fragment, useEffect, useMemo, useState } from 'react' import { Row } from 'react-bootstrap' import { Trans, useTranslation } from 'react-i18next' import { HistoryContent } from './history-content/history-content' -import { HistoryToolbar, HistoryToolbarState, initToolbarState } from './history-toolbar/history-toolbar' +import type { HistoryToolbarState } from './history-toolbar/history-toolbar' +import { HistoryToolbar, initToolbarState } from './history-toolbar/history-toolbar' import { sortAndFilterEntries } from './utils' import { refreshHistoryState } from '../../redux/history/methods' -import { HistoryEntry } from '../../redux/history/types' +import type { HistoryEntry } from '../../redux/history/types' import { showErrorNotification } from '../../redux/ui-notifications/methods' import { useApplicationState } from '../../hooks/common/use-application-state' diff --git a/src/components/history-page/history-table/history-table-row.tsx b/src/components/history-page/history-table/history-table-row.tsx index 09315ee60..152862a08 100644 --- a/src/components/history-page/history-table/history-table-row.tsx +++ b/src/components/history-page/history-table/history-table-row.tsx @@ -8,7 +8,7 @@ import React from 'react' import { Badge } from 'react-bootstrap' import { Link } from 'react-router-dom' import { EntryMenu } from '../entry-menu/entry-menu' -import { HistoryEntryProps, HistoryEventHandlers } from '../history-content/history-content' +import type { HistoryEntryProps, HistoryEventHandlers } from '../history-content/history-content' import { PinButton } from '../pin-button/pin-button' import { formatHistoryDate } from '../utils' diff --git a/src/components/history-page/history-table/history-table.tsx b/src/components/history-page/history-table/history-table.tsx index 770c4231e..5655bbe28 100644 --- a/src/components/history-page/history-table/history-table.tsx +++ b/src/components/history-page/history-table/history-table.tsx @@ -8,7 +8,7 @@ import React from 'react' import { Table } from 'react-bootstrap' import { Trans, useTranslation } from 'react-i18next' import { Pager } from '../../common/pagination/pager' -import { HistoryEntriesProps, HistoryEventHandlers } from '../history-content/history-content' +import type { HistoryEntriesProps, HistoryEventHandlers } from '../history-content/history-content' import { HistoryTableRow } from './history-table-row' import './history-table.scss' diff --git a/src/components/history-page/history-toolbar/history-toolbar.tsx b/src/components/history-page/history-toolbar/history-toolbar.tsx index b1c1f30c5..abfc287df 100644 --- a/src/components/history-page/history-toolbar/history-toolbar.tsx +++ b/src/components/history-page/history-toolbar/history-toolbar.tsx @@ -5,7 +5,8 @@ */ import equal from 'fast-deep-equal' -import React, { ChangeEvent, useCallback, useEffect, useMemo, useRef, useState } from 'react' +import type { ChangeEvent } from 'react' +import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react' import { Button, Form, FormControl, InputGroup, ToggleButton, ToggleButtonGroup } from 'react-bootstrap' import { Typeahead } from 'react-bootstrap-typeahead' import { Trans, useTranslation } from 'react-i18next' diff --git a/src/components/history-page/history-toolbar/import-history-button.tsx b/src/components/history-page/history-toolbar/import-history-button.tsx index 48a1abedc..0c83a2c48 100644 --- a/src/components/history-page/history-toolbar/import-history-button.tsx +++ b/src/components/history-page/history-toolbar/import-history-button.tsx @@ -9,7 +9,8 @@ import { Button } from 'react-bootstrap' import { Trans, useTranslation } from 'react-i18next' import { ForkAwesomeIcon } from '../../common/fork-awesome/fork-awesome-icon' import { ErrorModal } from '../../common/modals/error-modal' -import { HistoryEntry, HistoryEntryOrigin, HistoryExportJson, V1HistoryEntry } from '../../../redux/history/types' +import type { HistoryEntry, HistoryExportJson, V1HistoryEntry } from '../../../redux/history/types' +import { HistoryEntryOrigin } from '../../../redux/history/types' import { convertV1History, importHistoryEntries, diff --git a/src/components/history-page/sort-button/sort-button.tsx b/src/components/history-page/sort-button/sort-button.tsx index 3c31be2fe..bba8dc70f 100644 --- a/src/components/history-page/sort-button/sort-button.tsx +++ b/src/components/history-page/sort-button/sort-button.tsx @@ -5,8 +5,8 @@ */ import React from 'react' -import { ButtonProps } from 'react-bootstrap' -import { IconName } from '../../common/fork-awesome/types' +import type { ButtonProps } from 'react-bootstrap' +import type { IconName } from '../../common/fork-awesome/types' import { IconButton } from '../../common/icon-button/icon-button' export enum SortModeEnum { diff --git a/src/components/history-page/utils.ts b/src/components/history-page/utils.ts index 920052734..bd981b845 100644 --- a/src/components/history-page/utils.ts +++ b/src/components/history-page/utils.ts @@ -6,8 +6,8 @@ import { DateTime } from 'luxon' import { SortModeEnum } from './sort-button/sort-button' -import { HistoryToolbarState } from './history-toolbar/history-toolbar' -import { HistoryEntry } from '../../redux/history/types' +import type { HistoryToolbarState } from './history-toolbar/history-toolbar' +import type { HistoryEntry } from '../../redux/history/types' export const formatHistoryDate = (date: string): string => DateTime.fromISO(date).toFormat('DDDD T') diff --git a/src/components/landing-layout/footer/version-info/version-info-modal.tsx b/src/components/landing-layout/footer/version-info/version-info-modal.tsx index 11a14419b..fd89d325a 100644 --- a/src/components/landing-layout/footer/version-info/version-info-modal.tsx +++ b/src/components/landing-layout/footer/version-info/version-info-modal.tsx @@ -5,12 +5,13 @@ */ import React, { useMemo } from 'react' -import { CommonModal, CommonModalProps } from '../../../common/modals/common-modal' +import type { CommonModalProps } from '../../../common/modals/common-modal' +import { CommonModal } from '../../../common/modals/common-modal' import { Modal, Row } from 'react-bootstrap' import { VersionInfoModalColumn } from './version-info-modal-column' import frontendVersion from '../../../../version.json' import links from '../../../../links.json' -import { BackendVersion } from '../../../../api/config/types' +import type { BackendVersion } from '../../../../api/config/types' import { useApplicationState } from '../../../../hooks/common/use-application-state' export const VersionInfoModal: React.FC = ({ onHide, show }) => { diff --git a/src/components/landing-layout/navigation/sign-in-button.tsx b/src/components/landing-layout/navigation/sign-in-button.tsx index 206e371ae..bb80d59dd 100644 --- a/src/components/landing-layout/navigation/sign-in-button.tsx +++ b/src/components/landing-layout/navigation/sign-in-button.tsx @@ -6,7 +6,7 @@ import React, { useMemo } from 'react' import { Button } from 'react-bootstrap' -import { ButtonProps } from 'react-bootstrap/Button' +import type { ButtonProps } from 'react-bootstrap/Button' import { Trans, useTranslation } from 'react-i18next' import { LinkContainer } from 'react-router-bootstrap' import { ShowIf } from '../../common/show-if/show-if' diff --git a/src/components/login-page/auth/social-link-button/social-link-button.tsx b/src/components/login-page/auth/social-link-button/social-link-button.tsx index a9026b515..c7f6e76e0 100644 --- a/src/components/login-page/auth/social-link-button/social-link-button.tsx +++ b/src/components/login-page/auth/social-link-button/social-link-button.tsx @@ -6,7 +6,7 @@ import React from 'react' import { ForkAwesomeIcon } from '../../../common/fork-awesome/fork-awesome-icon' -import { IconName } from '../../../common/fork-awesome/types' +import type { IconName } from '../../../common/fork-awesome/types' import './social-link-button.scss' export interface SocialButtonProps { diff --git a/src/components/login-page/auth/via-internal.tsx b/src/components/login-page/auth/via-internal.tsx index 4e5f50832..5122d0063 100644 --- a/src/components/login-page/auth/via-internal.tsx +++ b/src/components/login-page/auth/via-internal.tsx @@ -4,7 +4,8 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import React, { FormEvent, useCallback, useState } from 'react' +import type { FormEvent } from 'react' +import React, { useCallback, useState } from 'react' import { Alert, Button, Card, Form } from 'react-bootstrap' import { Trans, useTranslation } from 'react-i18next' import { Link } from 'react-router-dom' diff --git a/src/components/login-page/auth/via-ldap.tsx b/src/components/login-page/auth/via-ldap.tsx index f9f28d520..c9feb6108 100644 --- a/src/components/login-page/auth/via-ldap.tsx +++ b/src/components/login-page/auth/via-ldap.tsx @@ -4,7 +4,8 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import React, { FormEvent, useCallback, useState } from 'react' +import type { FormEvent } from 'react' +import React, { useCallback, useState } from 'react' import { Alert, Button, Card, Form } from 'react-bootstrap' import { Trans, useTranslation } from 'react-i18next' diff --git a/src/components/login-page/auth/via-one-click.tsx b/src/components/login-page/auth/via-one-click.tsx index ef5d1856d..94b8885d1 100644 --- a/src/components/login-page/auth/via-one-click.tsx +++ b/src/components/login-page/auth/via-one-click.tsx @@ -6,7 +6,7 @@ import React from 'react' import { useApplicationState } from '../../../hooks/common/use-application-state' -import { IconName } from '../../common/fork-awesome/types' +import type { IconName } from '../../common/fork-awesome/types' import { SocialLinkButton } from './social-link-button/social-link-button' export enum OneClickType { diff --git a/src/components/login-page/auth/via-openid.tsx b/src/components/login-page/auth/via-openid.tsx index 6f0319e37..9236c9629 100644 --- a/src/components/login-page/auth/via-openid.tsx +++ b/src/components/login-page/auth/via-openid.tsx @@ -4,7 +4,8 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import React, { FormEvent, useState } from 'react' +import type { FormEvent } from 'react' +import React, { useState } from 'react' import { Alert, Button, Card, Form } from 'react-bootstrap' import { Trans, useTranslation } from 'react-i18next' import { doOpenIdLogin } from '../../../api/auth' diff --git a/src/components/markdown-renderer/common-markdown-renderer-props.ts b/src/components/markdown-renderer/common-markdown-renderer-props.ts index 2bc08742c..a1e1b2046 100644 --- a/src/components/markdown-renderer/common-markdown-renderer-props.ts +++ b/src/components/markdown-renderer/common-markdown-renderer-props.ts @@ -4,9 +4,9 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { TocAst } from 'markdown-it-toc-done-right' -import { ImageClickHandler } from './replace-components/image/image-replacer' -import { Ref } from 'react' +import type { TocAst } from 'markdown-it-toc-done-right' +import type { ImageClickHandler } from './replace-components/image/image-replacer' +import type { Ref } from 'react' export interface CommonMarkdownRendererProps { onFirstHeadingChange?: (firstHeading: string | undefined) => void diff --git a/src/components/markdown-renderer/document-length-limit-reached-alert.tsx b/src/components/markdown-renderer/document-length-limit-reached-alert.tsx index 7c15c91a3..f1afb9756 100644 --- a/src/components/markdown-renderer/document-length-limit-reached-alert.tsx +++ b/src/components/markdown-renderer/document-length-limit-reached-alert.tsx @@ -9,7 +9,7 @@ import { Alert } from 'react-bootstrap' import { Trans, useTranslation } from 'react-i18next' import { useApplicationState } from '../../hooks/common/use-application-state' import { ShowIf } from '../common/show-if/show-if' -import { SimpleAlertProps } from '../common/simple-alert/simple-alert-props' +import type { SimpleAlertProps } from '../common/simple-alert/simple-alert-props' export const DocumentLengthLimitReachedAlert: React.FC = ({ show }) => { useTranslation() diff --git a/src/components/markdown-renderer/document-markdown-renderer.tsx b/src/components/markdown-renderer/document-markdown-renderer.tsx index 2eae91826..b49df42fe 100644 --- a/src/components/markdown-renderer/document-markdown-renderer.tsx +++ b/src/components/markdown-renderer/document-markdown-renderer.tsx @@ -8,17 +8,17 @@ import React, { useMemo, useRef } from 'react' import { DocumentLengthLimitReachedAlert } from './document-length-limit-reached-alert' import { useConvertMarkdownToReactDom } from './hooks/use-convert-markdown-to-react-dom' import './markdown-renderer.scss' -import { LineMarkerPosition } from './types' +import type { LineMarkerPosition } from './types' import { useComponentReplacers } from './hooks/use-component-replacers' import { useTranslation } from 'react-i18next' -import { LineMarkers } from './replace-components/linemarker/line-number-marker' +import type { LineMarkers } from './replace-components/linemarker/line-number-marker' import { useCalculateLineMarkerPosition } from './utils/calculate-line-marker-positions' import { useExtractFirstHeadline } from './hooks/use-extract-first-headline' -import { TocAst } from 'markdown-it-toc-done-right' +import type { TocAst } from 'markdown-it-toc-done-right' import { useOnRefChange } from './hooks/use-on-ref-change' import { BasicMarkdownItConfigurator } from './markdown-it-configurator/basic-markdown-it-configurator' import { useTrimmedContent } from './hooks/use-trimmed-content' -import { CommonMarkdownRendererProps } from './common-markdown-renderer-props' +import type { CommonMarkdownRendererProps } from './common-markdown-renderer-props' export interface DocumentMarkdownRendererProps extends CommonMarkdownRendererProps { onLineMarkerPositionChanged?: (lineMarkerPosition: LineMarkerPosition[]) => void diff --git a/src/components/markdown-renderer/hooks/use-component-replacers.ts b/src/components/markdown-renderer/hooks/use-component-replacers.ts index b1db8c912..78a94faeb 100644 --- a/src/components/markdown-renderer/hooks/use-component-replacers.ts +++ b/src/components/markdown-renderer/hooks/use-component-replacers.ts @@ -7,13 +7,14 @@ import { useMemo } from 'react' import { AbcReplacer } from '../replace-components/abc/abc-replacer' import { AsciinemaReplacer } from '../replace-components/asciinema/asciinema-replacer' -import { ComponentReplacer } from '../replace-components/ComponentReplacer' +import type { ComponentReplacer } from '../replace-components/ComponentReplacer' import { CsvReplacer } from '../replace-components/csv/csv-replacer' import { FlowchartReplacer } from '../replace-components/flow/flowchart-replacer' import { GistReplacer } from '../replace-components/gist/gist-replacer' import { GraphvizReplacer } from '../replace-components/graphviz/graphviz-replacer' import { HighlightedCodeReplacer } from '../replace-components/highlighted-fence/highlighted-fence-replacer' -import { ImageClickHandler, ImageReplacer } from '../replace-components/image/image-replacer' +import type { ImageClickHandler } from '../replace-components/image/image-replacer' +import { ImageReplacer } from '../replace-components/image/image-replacer' import { KatexReplacer } from '../replace-components/katex/katex-replacer' import { LinemarkerReplacer } from '../replace-components/linemarker/linemarker-replacer' import { LinkReplacer } from '../replace-components/link-replacer/link-replacer' @@ -21,7 +22,8 @@ import { MarkmapReplacer } from '../replace-components/markmap/markmap-replacer' import { MermaidReplacer } from '../replace-components/mermaid/mermaid-replacer' import { ColoredBlockquoteReplacer } from '../replace-components/colored-blockquote/colored-blockquote-replacer' import { SequenceDiagramReplacer } from '../replace-components/sequence-diagram/sequence-diagram-replacer' -import { TaskCheckedChangeHandler, TaskListReplacer } from '../replace-components/task-list/task-list-replacer' +import type { TaskCheckedChangeHandler } from '../replace-components/task-list/task-list-replacer' +import { TaskListReplacer } from '../replace-components/task-list/task-list-replacer' import { VegaReplacer } from '../replace-components/vega-lite/vega-replacer' import { VimeoReplacer } from '../replace-components/vimeo/vimeo-replacer' import { YoutubeReplacer } from '../replace-components/youtube/youtube-replacer' diff --git a/src/components/markdown-renderer/hooks/use-convert-markdown-to-react-dom.ts b/src/components/markdown-renderer/hooks/use-convert-markdown-to-react-dom.ts index 3539aefc9..c0a67ca0b 100644 --- a/src/components/markdown-renderer/hooks/use-convert-markdown-to-react-dom.ts +++ b/src/components/markdown-renderer/hooks/use-convert-markdown-to-react-dom.ts @@ -4,14 +4,14 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import MarkdownIt from 'markdown-it/lib' +import type MarkdownIt from 'markdown-it/lib' import { useMemo, useRef } from 'react' -import { ComponentReplacer, ValidReactDomElement } from '../replace-components/ComponentReplacer' -import { LineKeys } from '../types' +import type { ComponentReplacer, ValidReactDomElement } from '../replace-components/ComponentReplacer' +import type { LineKeys } from '../types' import { buildTransformer } from '../utils/html-react-transformer' import { calculateNewLineNumberMapping } from '../utils/line-number-mapping' import convertHtmlToReact from '@hedgedoc/html-to-react' -import { Document } from 'domhandler' +import type { Document } from 'domhandler' /** * Renders markdown code into react elements diff --git a/src/components/markdown-renderer/hooks/use-extract-first-headline.ts b/src/components/markdown-renderer/hooks/use-extract-first-headline.ts index 6bdfb22c9..6a7e21af6 100644 --- a/src/components/markdown-renderer/hooks/use-extract-first-headline.ts +++ b/src/components/markdown-renderer/hooks/use-extract-first-headline.ts @@ -4,7 +4,8 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import React, { useCallback, useEffect, useRef } from 'react' +import type React from 'react' +import { useCallback, useEffect, useRef } from 'react' export const useExtractFirstHeadline = ( documentElement: React.RefObject, diff --git a/src/components/markdown-renderer/hooks/use-on-ref-change.ts b/src/components/markdown-renderer/hooks/use-on-ref-change.ts index e010a4400..ef8f0975d 100644 --- a/src/components/markdown-renderer/hooks/use-on-ref-change.ts +++ b/src/components/markdown-renderer/hooks/use-on-ref-change.ts @@ -5,7 +5,8 @@ */ import equal from 'fast-deep-equal' -import { MutableRefObject, useEffect, useRef } from 'react' +import type { MutableRefObject } from 'react' +import { useEffect, useRef } from 'react' export const useOnRefChange = ( reference: MutableRefObject, diff --git a/src/components/markdown-renderer/hooks/use-reveal.ts b/src/components/markdown-renderer/hooks/use-reveal.ts index bed68586c..f0f8074ba 100644 --- a/src/components/markdown-renderer/hooks/use-reveal.ts +++ b/src/components/markdown-renderer/hooks/use-reveal.ts @@ -7,7 +7,7 @@ import { useEffect, useRef, useState } from 'react' import Reveal from 'reveal.js' import { Logger } from '../../../utils/logger' -import { SlideOptions } from '../../common/note-frontmatter/types' +import type { SlideOptions } from '../../common/note-frontmatter/types' const log = new Logger('reveal.js') diff --git a/src/components/markdown-renderer/invalid-yaml-alert.tsx b/src/components/markdown-renderer/invalid-yaml-alert.tsx index e5131fcba..9366304a9 100644 --- a/src/components/markdown-renderer/invalid-yaml-alert.tsx +++ b/src/components/markdown-renderer/invalid-yaml-alert.tsx @@ -9,7 +9,7 @@ import { Alert } from 'react-bootstrap' import { Trans, useTranslation } from 'react-i18next' import { InternalLink } from '../common/links/internal-link' import { ShowIf } from '../common/show-if/show-if' -import { SimpleAlertProps } from '../common/simple-alert/simple-alert-props' +import type { SimpleAlertProps } from '../common/simple-alert/simple-alert-props' export const InvalidYamlAlert: React.FC = ({ show }) => { useTranslation() diff --git a/src/components/markdown-renderer/markdown-it-configurator/basic-markdown-it-configurator.ts b/src/components/markdown-renderer/markdown-it-configurator/basic-markdown-it-configurator.ts index 85e768feb..eba2df7ce 100644 --- a/src/components/markdown-renderer/markdown-it-configurator/basic-markdown-it-configurator.ts +++ b/src/components/markdown-renderer/markdown-it-configurator/basic-markdown-it-configurator.ts @@ -19,8 +19,9 @@ import { MarkdownItParserDebugger } from '../markdown-it-plugins/parser-debugger import { spoilerContainer } from '../markdown-it-plugins/spoiler-container' import { tasksLists } from '../markdown-it-plugins/tasks-lists' import { twitterEmojis } from '../markdown-it-plugins/twitter-emojis' -import { TocAst } from 'markdown-it-toc-done-right' -import { LineMarkers, lineNumberMarker } from '../replace-components/linemarker/line-number-marker' +import type { TocAst } from 'markdown-it-toc-done-right' +import type { LineMarkers } from '../replace-components/linemarker/line-number-marker' +import { lineNumberMarker } from '../replace-components/linemarker/line-number-marker' import { plantumlWithError } from '../markdown-it-plugins/plantuml' import { headlineAnchors } from '../markdown-it-plugins/headline-anchors' import { KatexReplacer } from '../replace-components/katex/katex-replacer' diff --git a/src/components/markdown-renderer/markdown-it-plugins/alert-container.ts b/src/components/markdown-renderer/markdown-it-plugins/alert-container.ts index b5948895c..7f0f66d3d 100644 --- a/src/components/markdown-renderer/markdown-it-plugins/alert-container.ts +++ b/src/components/markdown-renderer/markdown-it-plugins/alert-container.ts @@ -4,11 +4,11 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import MarkdownIt from 'markdown-it' +import type MarkdownIt from 'markdown-it' import markdownItContainer from 'markdown-it-container' -import Renderer from 'markdown-it/lib/renderer' -import Token from 'markdown-it/lib/token' -import { MarkdownItPlugin } from '../replace-components/ComponentReplacer' +import type Renderer from 'markdown-it/lib/renderer' +import type Token from 'markdown-it/lib/token' +import type { MarkdownItPlugin } from '../replace-components/ComponentReplacer' export type RenderContainerReturn = ( tokens: Token[], diff --git a/src/components/markdown-renderer/markdown-it-plugins/document-table-of-contents.ts b/src/components/markdown-renderer/markdown-it-plugins/document-table-of-contents.ts index e97ec4748..21114de49 100644 --- a/src/components/markdown-renderer/markdown-it-plugins/document-table-of-contents.ts +++ b/src/components/markdown-renderer/markdown-it-plugins/document-table-of-contents.ts @@ -4,8 +4,8 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import MarkdownIt from 'markdown-it/lib' -import { TocAst } from 'markdown-it-toc-done-right' +import type MarkdownIt from 'markdown-it/lib' +import type { TocAst } from 'markdown-it-toc-done-right' import { documentToc } from './document-toc' export const documentTableOfContents = (onTocChange: (toc: TocAst) => void): MarkdownIt.PluginSimple => { diff --git a/src/components/markdown-renderer/markdown-it-plugins/document-toc.ts b/src/components/markdown-renderer/markdown-it-plugins/document-toc.ts index b09c6acd1..7b276392a 100644 --- a/src/components/markdown-renderer/markdown-it-plugins/document-toc.ts +++ b/src/components/markdown-renderer/markdown-it-plugins/document-toc.ts @@ -4,8 +4,9 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import MarkdownIt from 'markdown-it' -import toc, { TocAst } from 'markdown-it-toc-done-right' +import type MarkdownIt from 'markdown-it' +import type { TocAst } from 'markdown-it-toc-done-right' +import toc from 'markdown-it-toc-done-right' import { tocSlugify } from '../../editor-page/table-of-contents/toc-slugify' export type DocumentTocPluginOptions = (ast: TocAst) => void diff --git a/src/components/markdown-renderer/markdown-it-plugins/headline-anchors.ts b/src/components/markdown-renderer/markdown-it-plugins/headline-anchors.ts index 0fa9a1a87..0c850a06f 100644 --- a/src/components/markdown-renderer/markdown-it-plugins/headline-anchors.ts +++ b/src/components/markdown-renderer/markdown-it-plugins/headline-anchors.ts @@ -4,7 +4,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import MarkdownIt from 'markdown-it' +import type MarkdownIt from 'markdown-it' import anchor from 'markdown-it-anchor' export const headlineAnchors: MarkdownIt.PluginSimple = (markdownIt) => { diff --git a/src/components/markdown-renderer/markdown-it-plugins/highlighted-code.ts b/src/components/markdown-renderer/markdown-it-plugins/highlighted-code.ts index a8549ddd6..f78f9044c 100644 --- a/src/components/markdown-renderer/markdown-it-plugins/highlighted-code.ts +++ b/src/components/markdown-renderer/markdown-it-plugins/highlighted-code.ts @@ -4,7 +4,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import MarkdownIt from 'markdown-it/lib' +import type MarkdownIt from 'markdown-it/lib' const highlightRegex = /^ *([\w-]*)(.*)$/ diff --git a/src/components/markdown-renderer/markdown-it-plugins/linkify-extra.ts b/src/components/markdown-renderer/markdown-it-plugins/linkify-extra.ts index ef9cc9609..9583f2edd 100644 --- a/src/components/markdown-renderer/markdown-it-plugins/linkify-extra.ts +++ b/src/components/markdown-renderer/markdown-it-plugins/linkify-extra.ts @@ -4,7 +4,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import MarkdownIt from 'markdown-it/lib' +import type MarkdownIt from 'markdown-it/lib' import linkify from 'markdown-it/lib/rules_core/linkify' export const linkifyExtra: MarkdownIt.PluginSimple = (md) => { diff --git a/src/components/markdown-renderer/markdown-it-plugins/parser-debugger.ts b/src/components/markdown-renderer/markdown-it-plugins/parser-debugger.ts index 966edbe37..646414d43 100644 --- a/src/components/markdown-renderer/markdown-it-plugins/parser-debugger.ts +++ b/src/components/markdown-renderer/markdown-it-plugins/parser-debugger.ts @@ -4,7 +4,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import MarkdownIt from 'markdown-it/lib' +import type MarkdownIt from 'markdown-it/lib' import { Logger } from '../../../utils/logger' const log = new Logger('MarkdownItParserDebugger') diff --git a/src/components/markdown-renderer/markdown-it-plugins/plantuml.ts b/src/components/markdown-renderer/markdown-it-plugins/plantuml.ts index e906db239..0710e2733 100644 --- a/src/components/markdown-renderer/markdown-it-plugins/plantuml.ts +++ b/src/components/markdown-renderer/markdown-it-plugins/plantuml.ts @@ -5,11 +5,13 @@ */ import plantuml from 'markdown-it-plantuml' -import MarkdownIt, { Options } from 'markdown-it/lib' -import Renderer, { RenderRule } from 'markdown-it/lib/renderer' -import Token from 'markdown-it/lib/token' +import type { Options } from 'markdown-it/lib' +import type MarkdownIt from 'markdown-it/lib' +import type { RenderRule } from 'markdown-it/lib/renderer' +import type Renderer from 'markdown-it/lib/renderer' +import type Token from 'markdown-it/lib/token' import { store } from '../../../redux' -import { MarkdownItPlugin } from '../replace-components/ComponentReplacer' +import type { MarkdownItPlugin } from '../replace-components/ComponentReplacer' export const plantumlWithError: MarkdownItPlugin = (markdownIt: MarkdownIt) => { const plantumlServer = store.getState().config.plantumlServer diff --git a/src/components/markdown-renderer/markdown-it-plugins/quote-extra-color.ts b/src/components/markdown-renderer/markdown-it-plugins/quote-extra-color.ts index 3f2d882ab..777f863a7 100644 --- a/src/components/markdown-renderer/markdown-it-plugins/quote-extra-color.ts +++ b/src/components/markdown-renderer/markdown-it-plugins/quote-extra-color.ts @@ -4,7 +4,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import MarkdownIt from 'markdown-it/lib' +import type MarkdownIt from 'markdown-it/lib' import { parseQuoteExtraTag } from './quote-extra' const cssColorRegex = diff --git a/src/components/markdown-renderer/markdown-it-plugins/quote-extra.test.ts b/src/components/markdown-renderer/markdown-it-plugins/quote-extra.test.ts index b59772b60..5069471bf 100644 --- a/src/components/markdown-renderer/markdown-it-plugins/quote-extra.test.ts +++ b/src/components/markdown-renderer/markdown-it-plugins/quote-extra.test.ts @@ -4,7 +4,8 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { parseQuoteExtraTag, QuoteExtraTagValues } from './quote-extra' +import type { QuoteExtraTagValues } from './quote-extra' +import { parseQuoteExtraTag } from './quote-extra' describe('Quote extra syntax parser', () => { it('should parse a valid tag', () => { diff --git a/src/components/markdown-renderer/markdown-it-plugins/quote-extra.ts b/src/components/markdown-renderer/markdown-it-plugins/quote-extra.ts index 7fdef4472..075c2a430 100644 --- a/src/components/markdown-renderer/markdown-it-plugins/quote-extra.ts +++ b/src/components/markdown-renderer/markdown-it-plugins/quote-extra.ts @@ -4,9 +4,9 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import MarkdownIt from 'markdown-it/lib' -import Token from 'markdown-it/lib/token' -import { IconName } from '../../common/fork-awesome/types' +import type MarkdownIt from 'markdown-it/lib' +import type Token from 'markdown-it/lib/token' +import type { IconName } from '../../common/fork-awesome/types' export const quoteExtra: (quoteLabel: string, icon: IconName) => MarkdownIt.PluginSimple = (quoteLabel: string, icon: IconName) => (md) => { diff --git a/src/components/markdown-renderer/markdown-it-plugins/reveal-sections.ts b/src/components/markdown-renderer/markdown-it-plugins/reveal-sections.ts index a0734f319..1a0c5069e 100644 --- a/src/components/markdown-renderer/markdown-it-plugins/reveal-sections.ts +++ b/src/components/markdown-renderer/markdown-it-plugins/reveal-sections.ts @@ -4,9 +4,9 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import MarkdownIt from 'markdown-it/lib' +import type MarkdownIt from 'markdown-it/lib' import Token from 'markdown-it/lib/token' -import StateCore from 'markdown-it/lib/rules_core/state_core' +import type StateCore from 'markdown-it/lib/rules_core/state_core' /** * This functions adds a 'section close' token at currentTokenIndex in the state's token array, diff --git a/src/components/markdown-renderer/markdown-it-plugins/spoiler-container.ts b/src/components/markdown-renderer/markdown-it-plugins/spoiler-container.ts index caa1d66cf..10a36f13f 100644 --- a/src/components/markdown-renderer/markdown-it-plugins/spoiler-container.ts +++ b/src/components/markdown-renderer/markdown-it-plugins/spoiler-container.ts @@ -4,12 +4,12 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import MarkdownIt from 'markdown-it' +import type MarkdownIt from 'markdown-it' import { escapeHtml } from 'markdown-it/lib/common/utils' import markdownItContainer from 'markdown-it-container' -import Token from 'markdown-it/lib/token' -import { MarkdownItPlugin } from '../replace-components/ComponentReplacer' -import { RenderContainerReturn } from './alert-container' +import type Token from 'markdown-it/lib/token' +import type { MarkdownItPlugin } from '../replace-components/ComponentReplacer' +import type { RenderContainerReturn } from './alert-container' export const spoilerRegEx = /^spoiler\s+(.*)$/ diff --git a/src/components/markdown-renderer/markdown-it-plugins/tasks-lists.ts b/src/components/markdown-renderer/markdown-it-plugins/tasks-lists.ts index 302609fe4..db44651e0 100644 --- a/src/components/markdown-renderer/markdown-it-plugins/tasks-lists.ts +++ b/src/components/markdown-renderer/markdown-it-plugins/tasks-lists.ts @@ -5,7 +5,7 @@ */ import markdownItTaskLists from '@hedgedoc/markdown-it-task-lists' -import MarkdownIt from 'markdown-it' +import type MarkdownIt from 'markdown-it' export const tasksLists: MarkdownIt.PluginSimple = (markdownIt) => { markdownItTaskLists(markdownIt, { diff --git a/src/components/markdown-renderer/markdown-it-plugins/twitter-emojis.ts b/src/components/markdown-renderer/markdown-it-plugins/twitter-emojis.ts index bb2d5cec6..8e44804f5 100644 --- a/src/components/markdown-renderer/markdown-it-plugins/twitter-emojis.ts +++ b/src/components/markdown-renderer/markdown-it-plugins/twitter-emojis.ts @@ -4,7 +4,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import MarkdownIt from 'markdown-it' +import type MarkdownIt from 'markdown-it' import emoji from 'markdown-it-emoji/bare' import { combinedEmojiData } from './emoji/mapping' diff --git a/src/components/markdown-renderer/process-reveal-comment-nodes.ts b/src/components/markdown-renderer/process-reveal-comment-nodes.ts index b820e771d..444daba75 100644 --- a/src/components/markdown-renderer/process-reveal-comment-nodes.ts +++ b/src/components/markdown-renderer/process-reveal-comment-nodes.ts @@ -3,7 +3,8 @@ * * SPDX-License-Identifier: AGPL-3.0-only */ -import { DataNode, Document, Element, hasChildren, isComment, isTag, Node } from 'domhandler' +import type { DataNode, Document, Element, Node } from 'domhandler' +import { hasChildren, isComment, isTag } from 'domhandler' import { Logger } from '../../utils/logger' const log = new Logger('reveal.js > Comment Node Preprocessor') diff --git a/src/components/markdown-renderer/regex-plugins/replace-legacy-pdf-short-code.ts b/src/components/markdown-renderer/regex-plugins/replace-legacy-pdf-short-code.ts index c3244f953..5643f5874 100644 --- a/src/components/markdown-renderer/regex-plugins/replace-legacy-pdf-short-code.ts +++ b/src/components/markdown-renderer/regex-plugins/replace-legacy-pdf-short-code.ts @@ -5,7 +5,7 @@ */ import markdownItRegex from 'markdown-it-regex' -import MarkdownIt from 'markdown-it/lib' +import type MarkdownIt from 'markdown-it/lib' const finalRegex = /^{%pdf (.*) ?%}$/ diff --git a/src/components/markdown-renderer/regex-plugins/replace-legacy-slideshare-short-code.ts b/src/components/markdown-renderer/regex-plugins/replace-legacy-slideshare-short-code.ts index 726d05b3d..e6db9b6e6 100644 --- a/src/components/markdown-renderer/regex-plugins/replace-legacy-slideshare-short-code.ts +++ b/src/components/markdown-renderer/regex-plugins/replace-legacy-slideshare-short-code.ts @@ -5,7 +5,7 @@ */ import markdownItRegex from 'markdown-it-regex' -import MarkdownIt from 'markdown-it/lib' +import type MarkdownIt from 'markdown-it/lib' const finalRegex = /^{%slideshare (\w+\/[\w-]+) ?%}$/ diff --git a/src/components/markdown-renderer/regex-plugins/replace-legacy-speakerdeck-short-code.ts b/src/components/markdown-renderer/regex-plugins/replace-legacy-speakerdeck-short-code.ts index 8aa2d54d2..2fcf97a9f 100644 --- a/src/components/markdown-renderer/regex-plugins/replace-legacy-speakerdeck-short-code.ts +++ b/src/components/markdown-renderer/regex-plugins/replace-legacy-speakerdeck-short-code.ts @@ -5,7 +5,7 @@ */ import markdownItRegex from 'markdown-it-regex' -import MarkdownIt from 'markdown-it/lib' +import type MarkdownIt from 'markdown-it/lib' const finalRegex = /^{%speakerdeck (\w+\/[\w-]+) ?%}$/ diff --git a/src/components/markdown-renderer/replace-components/ComponentReplacer.ts b/src/components/markdown-renderer/replace-components/ComponentReplacer.ts index 93c11b656..231a5f502 100644 --- a/src/components/markdown-renderer/replace-components/ComponentReplacer.ts +++ b/src/components/markdown-renderer/replace-components/ComponentReplacer.ts @@ -4,9 +4,10 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { Element, isText, NodeWithChildren } from 'domhandler' -import MarkdownIt from 'markdown-it' -import { ReactElement } from 'react' +import type { Element, NodeWithChildren } from 'domhandler' +import { isText } from 'domhandler' +import type MarkdownIt from 'markdown-it' +import type { ReactElement } from 'react' export type ValidReactDomElement = ReactElement | string | null diff --git a/src/components/markdown-renderer/replace-components/abc/abc-replacer.tsx b/src/components/markdown-renderer/replace-components/abc/abc-replacer.tsx index 9e93c46f5..de963ccdc 100644 --- a/src/components/markdown-renderer/replace-components/abc/abc-replacer.tsx +++ b/src/components/markdown-renderer/replace-components/abc/abc-replacer.tsx @@ -4,7 +4,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { Element } from 'domhandler' +import type { Element } from 'domhandler' import React from 'react' import { ComponentReplacer } from '../ComponentReplacer' import { AbcFrame } from './abc-frame' diff --git a/src/components/markdown-renderer/replace-components/asciinema/asciinema-replacer.tsx b/src/components/markdown-renderer/replace-components/asciinema/asciinema-replacer.tsx index a0fc14d37..0c1b050a2 100644 --- a/src/components/markdown-renderer/replace-components/asciinema/asciinema-replacer.tsx +++ b/src/components/markdown-renderer/replace-components/asciinema/asciinema-replacer.tsx @@ -4,8 +4,8 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { Element } from 'domhandler' -import MarkdownIt from 'markdown-it' +import type { Element } from 'domhandler' +import type MarkdownIt from 'markdown-it' import markdownItRegex from 'markdown-it-regex' import React from 'react' import { ComponentReplacer } from '../ComponentReplacer' diff --git a/src/components/markdown-renderer/replace-components/asciinema/replace-asciinema-link.ts b/src/components/markdown-renderer/replace-components/asciinema/replace-asciinema-link.ts index 8e72ca122..afa2c74a2 100644 --- a/src/components/markdown-renderer/replace-components/asciinema/replace-asciinema-link.ts +++ b/src/components/markdown-renderer/replace-components/asciinema/replace-asciinema-link.ts @@ -4,7 +4,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { RegexOptions } from '../../../../external-types/markdown-it-regex/interface' +import type { RegexOptions } from '../../../../external-types/markdown-it-regex/interface' const protocolRegex = /(?:http(?:s)?:\/\/)?/ const domainRegex = /(?:asciinema\.org\/a\/)/ diff --git a/src/components/markdown-renderer/replace-components/colored-blockquote/colored-blockquote-replacer.tsx b/src/components/markdown-renderer/replace-components/colored-blockquote/colored-blockquote-replacer.tsx index bcf319f6c..7440c4e92 100644 --- a/src/components/markdown-renderer/replace-components/colored-blockquote/colored-blockquote-replacer.tsx +++ b/src/components/markdown-renderer/replace-components/colored-blockquote/colored-blockquote-replacer.tsx @@ -4,8 +4,10 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { Element, isTag } from 'domhandler' -import { ComponentReplacer, NativeRenderer, SubNodeTransform, ValidReactDomElement } from '../ComponentReplacer' +import type { Element } from 'domhandler' +import { isTag } from 'domhandler' +import type { NativeRenderer, SubNodeTransform, ValidReactDomElement } from '../ComponentReplacer' +import { ComponentReplacer } from '../ComponentReplacer' /** * Checks if the given node is a blockquote color definition diff --git a/src/components/markdown-renderer/replace-components/csv/csv-replacer.tsx b/src/components/markdown-renderer/replace-components/csv/csv-replacer.tsx index ca24c2940..fdafb1668 100644 --- a/src/components/markdown-renderer/replace-components/csv/csv-replacer.tsx +++ b/src/components/markdown-renderer/replace-components/csv/csv-replacer.tsx @@ -4,7 +4,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { Element } from 'domhandler' +import type { Element } from 'domhandler' import React from 'react' import { ComponentReplacer } from '../ComponentReplacer' import { CsvTable } from './csv-table' diff --git a/src/components/markdown-renderer/replace-components/flow/flowchart-replacer.tsx b/src/components/markdown-renderer/replace-components/flow/flowchart-replacer.tsx index 8160d9953..c5f022882 100644 --- a/src/components/markdown-renderer/replace-components/flow/flowchart-replacer.tsx +++ b/src/components/markdown-renderer/replace-components/flow/flowchart-replacer.tsx @@ -4,7 +4,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { Element } from 'domhandler' +import type { Element } from 'domhandler' import React from 'react' import { ComponentReplacer } from '../ComponentReplacer' import { FlowChart } from './flowchart/flowchart' diff --git a/src/components/markdown-renderer/replace-components/gist/gist-replacer.tsx b/src/components/markdown-renderer/replace-components/gist/gist-replacer.tsx index 22f1f1a99..599b2b5de 100644 --- a/src/components/markdown-renderer/replace-components/gist/gist-replacer.tsx +++ b/src/components/markdown-renderer/replace-components/gist/gist-replacer.tsx @@ -4,8 +4,8 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { Element } from 'domhandler' -import MarkdownIt from 'markdown-it' +import type { Element } from 'domhandler' +import type MarkdownIt from 'markdown-it' import markdownItRegex from 'markdown-it-regex' import React from 'react' import { ComponentReplacer } from '../ComponentReplacer' diff --git a/src/components/markdown-renderer/replace-components/gist/replace-gist-link.ts b/src/components/markdown-renderer/replace-components/gist/replace-gist-link.ts index ae2e78c0a..d4a647d40 100644 --- a/src/components/markdown-renderer/replace-components/gist/replace-gist-link.ts +++ b/src/components/markdown-renderer/replace-components/gist/replace-gist-link.ts @@ -4,7 +4,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { RegexOptions } from '../../../../external-types/markdown-it-regex/interface' +import type { RegexOptions } from '../../../../external-types/markdown-it-regex/interface' const protocolRegex = /(?:http(?:s)?:\/\/)?/ const domainRegex = /(?:gist\.github\.com\/)/ diff --git a/src/components/markdown-renderer/replace-components/gist/replace-legacy-gist-short-code.ts b/src/components/markdown-renderer/replace-components/gist/replace-legacy-gist-short-code.ts index 6d3762b79..ab4b81b20 100644 --- a/src/components/markdown-renderer/replace-components/gist/replace-legacy-gist-short-code.ts +++ b/src/components/markdown-renderer/replace-components/gist/replace-legacy-gist-short-code.ts @@ -4,7 +4,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { RegexOptions } from '../../../../external-types/markdown-it-regex/interface' +import type { RegexOptions } from '../../../../external-types/markdown-it-regex/interface' const finalRegex = /^{%gist (\w+\/\w+) ?%}$/ diff --git a/src/components/markdown-renderer/replace-components/gist/use-resize-gist-frame.ts b/src/components/markdown-renderer/replace-components/gist/use-resize-gist-frame.ts index df7db906e..659c44165 100644 --- a/src/components/markdown-renderer/replace-components/gist/use-resize-gist-frame.ts +++ b/src/components/markdown-renderer/replace-components/gist/use-resize-gist-frame.ts @@ -4,7 +4,8 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import React, { useCallback, useEffect, useRef, useState } from 'react' +import type React from 'react' +import { useCallback, useEffect, useRef, useState } from 'react' /** * Determines if the left mouse button is pressed in the given event diff --git a/src/components/markdown-renderer/replace-components/graphviz/graphviz-replacer.tsx b/src/components/markdown-renderer/replace-components/graphviz/graphviz-replacer.tsx index ed7cd6304..d7fd28c1a 100644 --- a/src/components/markdown-renderer/replace-components/graphviz/graphviz-replacer.tsx +++ b/src/components/markdown-renderer/replace-components/graphviz/graphviz-replacer.tsx @@ -4,7 +4,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { Element } from 'domhandler' +import type { Element } from 'domhandler' import React from 'react' import { ComponentReplacer } from '../ComponentReplacer' import { GraphvizFrame } from './graphviz-frame' diff --git a/src/components/markdown-renderer/replace-components/highlighted-fence/highlighted-code/highlighted-code.tsx b/src/components/markdown-renderer/replace-components/highlighted-fence/highlighted-code/highlighted-code.tsx index e1c29f981..f5ad5b7ca 100644 --- a/src/components/markdown-renderer/replace-components/highlighted-fence/highlighted-code/highlighted-code.tsx +++ b/src/components/markdown-renderer/replace-components/highlighted-fence/highlighted-code/highlighted-code.tsx @@ -4,7 +4,8 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import React, { Fragment, ReactElement, useEffect, useState } from 'react' +import type { ReactElement } from 'react' +import React, { Fragment, useEffect, useState } from 'react' import convertHtmlToReact from '@hedgedoc/html-to-react' import { CopyToClipboardButton } from '../../../../common/copyable/copy-to-clipboard-button/copy-to-clipboard-button' import '../../../utils/button-inside.scss' diff --git a/src/components/markdown-renderer/replace-components/highlighted-fence/highlighted-fence-replacer.tsx b/src/components/markdown-renderer/replace-components/highlighted-fence/highlighted-fence-replacer.tsx index 3d9bf5409..5f14e97f3 100644 --- a/src/components/markdown-renderer/replace-components/highlighted-fence/highlighted-fence-replacer.tsx +++ b/src/components/markdown-renderer/replace-components/highlighted-fence/highlighted-fence-replacer.tsx @@ -4,7 +4,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { Element } from 'domhandler' +import type { Element } from 'domhandler' import React from 'react' import { ComponentReplacer } from '../ComponentReplacer' import { HighlightedCode } from './highlighted-code/highlighted-code' diff --git a/src/components/markdown-renderer/replace-components/image/image-replacer.tsx b/src/components/markdown-renderer/replace-components/image/image-replacer.tsx index 7524c9446..9a9af4e79 100644 --- a/src/components/markdown-renderer/replace-components/image/image-replacer.tsx +++ b/src/components/markdown-renderer/replace-components/image/image-replacer.tsx @@ -4,7 +4,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { Element } from 'domhandler' +import type { Element } from 'domhandler' import React from 'react' import { ComponentReplacer } from '../ComponentReplacer' import { ProxyImageFrame } from './proxy-image-frame' diff --git a/src/components/markdown-renderer/replace-components/katex/katex-replacer.tsx b/src/components/markdown-renderer/replace-components/katex/katex-replacer.tsx index a15035026..a18d76a6e 100644 --- a/src/components/markdown-renderer/replace-components/katex/katex-replacer.tsx +++ b/src/components/markdown-renderer/replace-components/katex/katex-replacer.tsx @@ -4,8 +4,9 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { Element, isTag } from 'domhandler' -import MarkdownIt from 'markdown-it' +import type { Element } from 'domhandler' +import { isTag } from 'domhandler' +import type MarkdownIt from 'markdown-it' import mathJax from 'markdown-it-mathjax' import React from 'react' import { ComponentReplacer } from '../ComponentReplacer' diff --git a/src/components/markdown-renderer/replace-components/linemarker/line-number-marker.ts b/src/components/markdown-renderer/replace-components/linemarker/line-number-marker.ts index 9b0e33b6e..498d6f5ae 100644 --- a/src/components/markdown-renderer/replace-components/linemarker/line-number-marker.ts +++ b/src/components/markdown-renderer/replace-components/linemarker/line-number-marker.ts @@ -4,7 +4,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import MarkdownIt from 'markdown-it/lib' +import type MarkdownIt from 'markdown-it/lib' import Token from 'markdown-it/lib/token' export interface LineMarkers { diff --git a/src/components/markdown-renderer/replace-components/linemarker/linemarker-replacer.tsx b/src/components/markdown-renderer/replace-components/linemarker/linemarker-replacer.tsx index feee334d3..8a2d785a3 100644 --- a/src/components/markdown-renderer/replace-components/linemarker/linemarker-replacer.tsx +++ b/src/components/markdown-renderer/replace-components/linemarker/linemarker-replacer.tsx @@ -4,7 +4,7 @@ SPDX-License-Identifier: AGPL-3.0-only */ -import { Element } from 'domhandler' +import type { Element } from 'domhandler' import { ComponentReplacer } from '../ComponentReplacer' /** diff --git a/src/components/markdown-renderer/replace-components/link-replacer/link-replacer.tsx b/src/components/markdown-renderer/replace-components/link-replacer/link-replacer.tsx index 5ba532f17..646c7357e 100644 --- a/src/components/markdown-renderer/replace-components/link-replacer/link-replacer.tsx +++ b/src/components/markdown-renderer/replace-components/link-replacer/link-replacer.tsx @@ -3,9 +3,10 @@ * * SPDX-License-Identifier: AGPL-3.0-only */ -import { Element } from 'domhandler' +import type { Element } from 'domhandler' import React from 'react' -import { ComponentReplacer, NativeRenderer, SubNodeTransform, ValidReactDomElement } from '../ComponentReplacer' +import type { NativeRenderer, SubNodeTransform, ValidReactDomElement } from '../ComponentReplacer' +import { ComponentReplacer } from '../ComponentReplacer' export const createJumpToMarkClickEventHandler = (id: string) => { return (event: React.MouseEvent): void => { diff --git a/src/components/markdown-renderer/replace-components/markmap/markmap-replacer.tsx b/src/components/markdown-renderer/replace-components/markmap/markmap-replacer.tsx index aad085c37..bcfa05092 100644 --- a/src/components/markdown-renderer/replace-components/markmap/markmap-replacer.tsx +++ b/src/components/markdown-renderer/replace-components/markmap/markmap-replacer.tsx @@ -4,7 +4,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { Element } from 'domhandler' +import type { Element } from 'domhandler' import React from 'react' import { ComponentReplacer } from '../ComponentReplacer' import { MarkmapFrame } from './markmap-frame' diff --git a/src/components/markdown-renderer/replace-components/mermaid/mermaid-replacer.tsx b/src/components/markdown-renderer/replace-components/mermaid/mermaid-replacer.tsx index 018edc53e..6bbd916c4 100644 --- a/src/components/markdown-renderer/replace-components/mermaid/mermaid-replacer.tsx +++ b/src/components/markdown-renderer/replace-components/mermaid/mermaid-replacer.tsx @@ -4,7 +4,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { Element } from 'domhandler' +import type { Element } from 'domhandler' import React from 'react' import { ComponentReplacer } from '../ComponentReplacer' import { MermaidChart } from './mermaid-chart' diff --git a/src/components/markdown-renderer/replace-components/one-click-frame/one-click-embedding.tsx b/src/components/markdown-renderer/replace-components/one-click-frame/one-click-embedding.tsx index 2fd31608d..03d426ced 100644 --- a/src/components/markdown-renderer/replace-components/one-click-frame/one-click-embedding.tsx +++ b/src/components/markdown-renderer/replace-components/one-click-frame/one-click-embedding.tsx @@ -6,7 +6,7 @@ import React, { useEffect, useState } from 'react' import { Trans } from 'react-i18next' -import { IconName } from '../../../common/fork-awesome/types' +import type { IconName } from '../../../common/fork-awesome/types' import { ShowIf } from '../../../common/show-if/show-if' import './one-click-embedding.scss' import { ProxyImageFrame } from '../image/proxy-image-frame' diff --git a/src/components/markdown-renderer/replace-components/sequence-diagram/sequence-diagram-replacer.tsx b/src/components/markdown-renderer/replace-components/sequence-diagram/sequence-diagram-replacer.tsx index 47d374db4..10057f80d 100644 --- a/src/components/markdown-renderer/replace-components/sequence-diagram/sequence-diagram-replacer.tsx +++ b/src/components/markdown-renderer/replace-components/sequence-diagram/sequence-diagram-replacer.tsx @@ -4,7 +4,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { Element } from 'domhandler' +import type { Element } from 'domhandler' import React, { Fragment } from 'react' import { ComponentReplacer } from '../ComponentReplacer' import { MermaidChart } from '../mermaid/mermaid-chart' diff --git a/src/components/markdown-renderer/replace-components/task-list/task-list-replacer.tsx b/src/components/markdown-renderer/replace-components/task-list/task-list-replacer.tsx index 5a4996eac..241ed542c 100644 --- a/src/components/markdown-renderer/replace-components/task-list/task-list-replacer.tsx +++ b/src/components/markdown-renderer/replace-components/task-list/task-list-replacer.tsx @@ -4,8 +4,9 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { Element } from 'domhandler' -import React, { ReactElement } from 'react' +import type { Element } from 'domhandler' +import type { ReactElement } from 'react' +import React from 'react' import { ComponentReplacer } from '../ComponentReplacer' export type TaskCheckedChangeHandler = (lineInMarkdown: number, checked: boolean) => void diff --git a/src/components/markdown-renderer/replace-components/utils.ts b/src/components/markdown-renderer/replace-components/utils.ts index 6b290c77d..1254c2561 100644 --- a/src/components/markdown-renderer/replace-components/utils.ts +++ b/src/components/markdown-renderer/replace-components/utils.ts @@ -4,7 +4,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { Element } from 'domhandler' +import type { Element } from 'domhandler' export const getAttributesFromHedgeDocTag = (node: Element, tagName: string): { [s: string]: string } | undefined => { if (node.name !== `app-${tagName}` || !node.attribs) { diff --git a/src/components/markdown-renderer/replace-components/vega-lite/vega-chart.tsx b/src/components/markdown-renderer/replace-components/vega-lite/vega-chart.tsx index b2ca5daf7..daea929a2 100644 --- a/src/components/markdown-renderer/replace-components/vega-lite/vega-chart.tsx +++ b/src/components/markdown-renderer/replace-components/vega-lite/vega-chart.tsx @@ -7,7 +7,7 @@ import React, { Fragment, useCallback, useEffect, useRef, useState } from 'react' import { Alert } from 'react-bootstrap' import { useTranslation } from 'react-i18next' -import { VisualizationSpec } from 'vega-embed' +import type { VisualizationSpec } from 'vega-embed' import { ShowIf } from '../../../common/show-if/show-if' import { Logger } from '../../../../utils/logger' diff --git a/src/components/markdown-renderer/replace-components/vega-lite/vega-replacer.tsx b/src/components/markdown-renderer/replace-components/vega-lite/vega-replacer.tsx index ba701e489..a689a640a 100644 --- a/src/components/markdown-renderer/replace-components/vega-lite/vega-replacer.tsx +++ b/src/components/markdown-renderer/replace-components/vega-lite/vega-replacer.tsx @@ -4,7 +4,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { Element } from 'domhandler' +import type { Element } from 'domhandler' import React from 'react' import { ComponentReplacer } from '../ComponentReplacer' import { VegaChart } from './vega-chart' diff --git a/src/components/markdown-renderer/replace-components/vimeo/replace-legacy-vimeo-short-code.ts b/src/components/markdown-renderer/replace-components/vimeo/replace-legacy-vimeo-short-code.ts index bb049f70a..6f96ff1b5 100644 --- a/src/components/markdown-renderer/replace-components/vimeo/replace-legacy-vimeo-short-code.ts +++ b/src/components/markdown-renderer/replace-components/vimeo/replace-legacy-vimeo-short-code.ts @@ -4,7 +4,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { RegexOptions } from '../../../../external-types/markdown-it-regex/interface' +import type { RegexOptions } from '../../../../external-types/markdown-it-regex/interface' export const replaceLegacyVimeoShortCode: RegexOptions = { name: 'legacy-vimeo-short-code', diff --git a/src/components/markdown-renderer/replace-components/vimeo/replace-vimeo-link.ts b/src/components/markdown-renderer/replace-components/vimeo/replace-vimeo-link.ts index f5f1315d1..3c988df63 100644 --- a/src/components/markdown-renderer/replace-components/vimeo/replace-vimeo-link.ts +++ b/src/components/markdown-renderer/replace-components/vimeo/replace-vimeo-link.ts @@ -4,7 +4,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { RegexOptions } from '../../../../external-types/markdown-it-regex/interface' +import type { RegexOptions } from '../../../../external-types/markdown-it-regex/interface' const protocolRegex = /(?:http(?:s)?:\/\/)?/ const domainRegex = /(?:player\.)?(?:vimeo\.com\/)(?:(?:channels|album|ondemand|groups)\/\w+\/)?(?:video\/)?/ diff --git a/src/components/markdown-renderer/replace-components/vimeo/vimeo-replacer.tsx b/src/components/markdown-renderer/replace-components/vimeo/vimeo-replacer.tsx index abd47c965..c8b204b71 100644 --- a/src/components/markdown-renderer/replace-components/vimeo/vimeo-replacer.tsx +++ b/src/components/markdown-renderer/replace-components/vimeo/vimeo-replacer.tsx @@ -4,8 +4,8 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { Element } from 'domhandler' -import MarkdownIt from 'markdown-it' +import type { Element } from 'domhandler' +import type MarkdownIt from 'markdown-it' import markdownItRegex from 'markdown-it-regex' import React from 'react' import { ComponentReplacer } from '../ComponentReplacer' diff --git a/src/components/markdown-renderer/replace-components/youtube/replace-legacy-youtube-short-code.ts b/src/components/markdown-renderer/replace-components/youtube/replace-legacy-youtube-short-code.ts index c59986298..c9b64f4f4 100644 --- a/src/components/markdown-renderer/replace-components/youtube/replace-legacy-youtube-short-code.ts +++ b/src/components/markdown-renderer/replace-components/youtube/replace-legacy-youtube-short-code.ts @@ -4,7 +4,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { RegexOptions } from '../../../../external-types/markdown-it-regex/interface' +import type { RegexOptions } from '../../../../external-types/markdown-it-regex/interface' export const replaceLegacyYoutubeShortCode: RegexOptions = { name: 'legacy-youtube-short-code', diff --git a/src/components/markdown-renderer/replace-components/youtube/replace-youtube-link.ts b/src/components/markdown-renderer/replace-components/youtube/replace-youtube-link.ts index fc0032bd3..bb1a726c2 100644 --- a/src/components/markdown-renderer/replace-components/youtube/replace-youtube-link.ts +++ b/src/components/markdown-renderer/replace-components/youtube/replace-youtube-link.ts @@ -4,7 +4,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { RegexOptions } from '../../../../external-types/markdown-it-regex/interface' +import type { RegexOptions } from '../../../../external-types/markdown-it-regex/interface' const protocolRegex = /(?:http(?:s)?:\/\/)?/ const subdomainRegex = /(?:www.)?/ diff --git a/src/components/markdown-renderer/replace-components/youtube/youtube-replacer.tsx b/src/components/markdown-renderer/replace-components/youtube/youtube-replacer.tsx index fff2d8031..304053e8a 100644 --- a/src/components/markdown-renderer/replace-components/youtube/youtube-replacer.tsx +++ b/src/components/markdown-renderer/replace-components/youtube/youtube-replacer.tsx @@ -4,8 +4,8 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { Element } from 'domhandler' -import MarkdownIt from 'markdown-it' +import type { Element } from 'domhandler' +import type MarkdownIt from 'markdown-it' import markdownItRegex from 'markdown-it-regex' import React from 'react' import { ComponentReplacer } from '../ComponentReplacer' diff --git a/src/components/markdown-renderer/slideshow-markdown-renderer.tsx b/src/components/markdown-renderer/slideshow-markdown-renderer.tsx index 97512cb06..650439fd1 100644 --- a/src/components/markdown-renderer/slideshow-markdown-renderer.tsx +++ b/src/components/markdown-renderer/slideshow-markdown-renderer.tsx @@ -9,17 +9,17 @@ import { useConvertMarkdownToReactDom } from './hooks/use-convert-markdown-to-re import './markdown-renderer.scss' import { useComponentReplacers } from './hooks/use-component-replacers' import { useExtractFirstHeadline } from './hooks/use-extract-first-headline' -import { TocAst } from 'markdown-it-toc-done-right' +import type { TocAst } from 'markdown-it-toc-done-right' import { useOnRefChange } from './hooks/use-on-ref-change' import { useTrimmedContent } from './hooks/use-trimmed-content' import { REVEAL_STATUS, useReveal } from './hooks/use-reveal' import './slideshow.scss' -import { ScrollProps } from '../editor-page/synced-scroll/scroll-props' +import type { ScrollProps } from '../editor-page/synced-scroll/scroll-props' import { DocumentLengthLimitReachedAlert } from './document-length-limit-reached-alert' import { BasicMarkdownItConfigurator } from './markdown-it-configurator/basic-markdown-it-configurator' -import { SlideOptions } from '../common/note-frontmatter/types' +import type { SlideOptions } from '../common/note-frontmatter/types' import { processRevealCommentNodes } from './process-reveal-comment-nodes' -import { CommonMarkdownRendererProps } from './common-markdown-renderer-props' +import type { CommonMarkdownRendererProps } from './common-markdown-renderer-props' import { LoadingSlide } from './loading-slide' export interface SlideshowMarkdownRendererProps extends CommonMarkdownRendererProps { diff --git a/src/components/markdown-renderer/utils/calculate-line-marker-positions.ts b/src/components/markdown-renderer/utils/calculate-line-marker-positions.ts index 67bd44c31..d8b697c44 100644 --- a/src/components/markdown-renderer/utils/calculate-line-marker-positions.ts +++ b/src/components/markdown-renderer/utils/calculate-line-marker-positions.ts @@ -5,10 +5,11 @@ */ import equal from 'fast-deep-equal' -import { RefObject, useCallback, useEffect, useRef } from 'react' +import type { RefObject } from 'react' +import { useCallback, useEffect, useRef } from 'react' import useResizeObserver from 'use-resize-observer' -import { LineMarkerPosition } from '../types' -import { LineMarkers } from '../replace-components/linemarker/line-number-marker' +import type { LineMarkerPosition } from '../types' +import type { LineMarkers } from '../replace-components/linemarker/line-number-marker' export const calculateLineMarkerPositions = ( documentElement: HTMLDivElement, diff --git a/src/components/markdown-renderer/utils/html-react-transformer.tsx b/src/components/markdown-renderer/utils/html-react-transformer.tsx index e32231982..f954b8577 100644 --- a/src/components/markdown-renderer/utils/html-react-transformer.tsx +++ b/src/components/markdown-renderer/utils/html-react-transformer.tsx @@ -4,17 +4,18 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { Element, isTag } from 'domhandler' +import type { Element } from 'domhandler' +import { isTag } from 'domhandler' import React, { Suspense } from 'react' import { convertNodeToReactElement } from '@hedgedoc/html-to-react/dist/convertNodeToReactElement' -import { +import type { ComponentReplacer, NativeRenderer, SubNodeTransform, ValidReactDomElement } from '../replace-components/ComponentReplacer' -import { LineKeys } from '../types' -import { NodeToReactElementTransformer } from '@hedgedoc/html-to-react/dist/NodeToReactElementTransformer' +import type { LineKeys } from '../types' +import type { NodeToReactElementTransformer } from '@hedgedoc/html-to-react/dist/NodeToReactElementTransformer' export interface TextDifferenceResult { lines: LineKeys[] diff --git a/src/components/markdown-renderer/utils/line-number-mapping.ts b/src/components/markdown-renderer/utils/line-number-mapping.ts index 8cf8ca61f..9dbedb62d 100644 --- a/src/components/markdown-renderer/utils/line-number-mapping.ts +++ b/src/components/markdown-renderer/utils/line-number-mapping.ts @@ -5,8 +5,8 @@ */ import { diffArrays } from 'diff' -import { TextDifferenceResult } from './html-react-transformer' -import { LineKeys } from '../types' +import type { TextDifferenceResult } from './html-react-transformer' +import type { LineKeys } from '../types' export const calculateNewLineNumberMapping = ( newMarkdownLines: string[], diff --git a/src/components/notifications/ui-notification-toast.tsx b/src/components/notifications/ui-notification-toast.tsx index 08208d57c..009d711ee 100644 --- a/src/components/notifications/ui-notification-toast.tsx +++ b/src/components/notifications/ui-notification-toast.tsx @@ -6,10 +6,10 @@ import React, { Fragment, useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react' import { Button, ProgressBar, Toast } from 'react-bootstrap' -import { UiNotification } from '../../redux/ui-notifications/types' +import type { UiNotification } from '../../redux/ui-notifications/types' import { ForkAwesomeIcon } from '../common/fork-awesome/fork-awesome-icon' import { ShowIf } from '../common/show-if/show-if' -import { IconName } from '../common/fork-awesome/types' +import type { IconName } from '../common/fork-awesome/types' import { dismissUiNotification } from '../../redux/ui-notifications/methods' import { Trans, useTranslation } from 'react-i18next' import { Logger } from '../../utils/logger' diff --git a/src/components/profile-page/access-tokens/profile-access-tokens.tsx b/src/components/profile-page/access-tokens/profile-access-tokens.tsx index 34be58332..9bed00ee4 100644 --- a/src/components/profile-page/access-tokens/profile-access-tokens.tsx +++ b/src/components/profile-page/access-tokens/profile-access-tokens.tsx @@ -5,11 +5,12 @@ */ import { DateTime } from 'luxon' -import React, { ChangeEvent, FormEvent, Fragment, useCallback, useEffect, useMemo, useState } from 'react' +import type { ChangeEvent, FormEvent } from 'react' +import React, { Fragment, useCallback, useEffect, useMemo, useState } from 'react' import { Button, Card, Col, Form, ListGroup, Modal, Row } from 'react-bootstrap' import { Trans, useTranslation } from 'react-i18next' import { deleteAccessToken, getAccessTokenList, postNewAccessToken } from '../../../api/tokens' -import { AccessToken } from '../../../api/tokens/types' +import type { AccessToken } from '../../../api/tokens/types' import { CopyableField } from '../../common/copyable/copyable-field/copyable-field' import { IconButton } from '../../common/icon-button/icon-button' import { CommonModal } from '../../common/modals/common-modal' diff --git a/src/components/profile-page/settings/profile-change-password.tsx b/src/components/profile-page/settings/profile-change-password.tsx index 89a569539..b661a2bed 100644 --- a/src/components/profile-page/settings/profile-change-password.tsx +++ b/src/components/profile-page/settings/profile-change-password.tsx @@ -4,7 +4,8 @@ SPDX-License-Identifier: AGPL-3.0-only */ -import React, { ChangeEvent, FormEvent, useState } from 'react' +import type { ChangeEvent, FormEvent } from 'react' +import React, { useState } from 'react' import { Button, Card, Form } from 'react-bootstrap' import { Trans, useTranslation } from 'react-i18next' import { changePassword } from '../../../api/me' diff --git a/src/components/profile-page/settings/profile-display-name.tsx b/src/components/profile-page/settings/profile-display-name.tsx index 86b99ff54..10f4abaf3 100644 --- a/src/components/profile-page/settings/profile-display-name.tsx +++ b/src/components/profile-page/settings/profile-display-name.tsx @@ -4,7 +4,8 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import React, { ChangeEvent, FormEvent, useEffect, useState } from 'react' +import type { ChangeEvent, FormEvent } from 'react' +import React, { useEffect, useState } from 'react' import { Alert, Button, Card, Form } from 'react-bootstrap' import { Trans, useTranslation } from 'react-i18next' import { updateDisplayName } from '../../../api/me' diff --git a/src/components/register-page/register-page.tsx b/src/components/register-page/register-page.tsx index 114e8a22f..f4d0dffbc 100644 --- a/src/components/register-page/register-page.tsx +++ b/src/components/register-page/register-page.tsx @@ -4,7 +4,8 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import React, { FormEvent, Fragment, useCallback, useEffect, useState } from 'react' +import type { FormEvent } from 'react' +import React, { Fragment, useCallback, useEffect, useState } from 'react' import { Alert, Button, Card, Col, Form, Row } from 'react-bootstrap' import { Trans, useTranslation } from 'react-i18next' import { Redirect } from 'react-router' diff --git a/src/components/render-page/hooks/sync-scroll/use-document-sync-scrolling.ts b/src/components/render-page/hooks/sync-scroll/use-document-sync-scrolling.ts index 1b5885370..8d4ede61b 100644 --- a/src/components/render-page/hooks/sync-scroll/use-document-sync-scrolling.ts +++ b/src/components/render-page/hooks/sync-scroll/use-document-sync-scrolling.ts @@ -4,9 +4,10 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import React, { useCallback, useState } from 'react' -import { LineMarkerPosition } from '../../../markdown-renderer/types' -import { ScrollState } from '../../../editor-page/synced-scroll/scroll-props' +import type React from 'react' +import { useCallback, useState } from 'react' +import type { LineMarkerPosition } from '../../../markdown-renderer/types' +import type { ScrollState } from '../../../editor-page/synced-scroll/scroll-props' import { useOnUserScroll } from './use-on-user-scroll' import { useScrollToLineMark } from './use-scroll-to-line-mark' diff --git a/src/components/render-page/hooks/sync-scroll/use-on-user-scroll.ts b/src/components/render-page/hooks/sync-scroll/use-on-user-scroll.ts index ffe9ee296..a11391bbe 100644 --- a/src/components/render-page/hooks/sync-scroll/use-on-user-scroll.ts +++ b/src/components/render-page/hooks/sync-scroll/use-on-user-scroll.ts @@ -4,9 +4,10 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { RefObject, useCallback } from 'react' -import { LineMarkerPosition } from '../../../markdown-renderer/types' -import { ScrollState } from '../../../editor-page/synced-scroll/scroll-props' +import type { RefObject } from 'react' +import { useCallback } from 'react' +import type { LineMarkerPosition } from '../../../markdown-renderer/types' +import type { ScrollState } from '../../../editor-page/synced-scroll/scroll-props' export const useOnUserScroll = ( lineMarks: LineMarkerPosition[] | undefined, diff --git a/src/components/render-page/hooks/sync-scroll/use-scroll-to-line-mark.ts b/src/components/render-page/hooks/sync-scroll/use-scroll-to-line-mark.ts index 9e37abf6f..3d51038d4 100644 --- a/src/components/render-page/hooks/sync-scroll/use-scroll-to-line-mark.ts +++ b/src/components/render-page/hooks/sync-scroll/use-scroll-to-line-mark.ts @@ -4,9 +4,10 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { RefObject, useCallback, useEffect, useRef } from 'react' -import { LineMarkerPosition } from '../../../markdown-renderer/types' -import { ScrollState } from '../../../editor-page/synced-scroll/scroll-props' +import type { RefObject } from 'react' +import { useCallback, useEffect, useRef } from 'react' +import type { LineMarkerPosition } from '../../../markdown-renderer/types' +import type { ScrollState } from '../../../editor-page/synced-scroll/scroll-props' import { findLineMarks } from '../../../editor-page/synced-scroll/utils' export const useScrollToLineMark = ( diff --git a/src/components/render-page/hooks/use-image-click-handler.ts b/src/components/render-page/hooks/use-image-click-handler.ts index 718375726..867c19ee4 100644 --- a/src/components/render-page/hooks/use-image-click-handler.ts +++ b/src/components/render-page/hooks/use-image-click-handler.ts @@ -4,9 +4,10 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import React, { useCallback } from 'react' -import { ImageClickHandler } from '../../markdown-renderer/replace-components/image/image-replacer' -import { RendererToEditorCommunicator } from '../window-post-message-communicator/renderer-to-editor-communicator' +import type React from 'react' +import { useCallback } from 'react' +import type { ImageClickHandler } from '../../markdown-renderer/replace-components/image/image-replacer' +import type { RendererToEditorCommunicator } from '../window-post-message-communicator/renderer-to-editor-communicator' import { CommunicationMessageType } from '../window-post-message-communicator/rendering-message' export const useImageClickHandler = (iframeCommunicator: RendererToEditorCommunicator): ImageClickHandler => { diff --git a/src/components/render-page/iframe-markdown-renderer.tsx b/src/components/render-page/iframe-markdown-renderer.tsx index 4ef54ede0..2a477404b 100644 --- a/src/components/render-page/iframe-markdown-renderer.tsx +++ b/src/components/render-page/iframe-markdown-renderer.tsx @@ -5,18 +5,15 @@ */ import React, { useCallback, useState } from 'react' -import { ScrollState } from '../editor-page/synced-scroll/scroll-props' -import { - BaseConfiguration, - CommunicationMessageType, - RendererType -} from './window-post-message-communicator/rendering-message' +import type { ScrollState } from '../editor-page/synced-scroll/scroll-props' +import type { BaseConfiguration } from './window-post-message-communicator/rendering-message' +import { CommunicationMessageType, RendererType } from './window-post-message-communicator/rendering-message' import { setDarkMode } from '../../redux/dark-mode/methods' -import { ImageClickHandler } from '../markdown-renderer/replace-components/image/image-replacer' +import type { ImageClickHandler } from '../markdown-renderer/replace-components/image/image-replacer' import { useImageClickHandler } from './hooks/use-image-click-handler' import { MarkdownDocument } from './markdown-document' import { countWords } from './word-counter' -import { RendererFrontmatterInfo } from '../common/note-frontmatter/types' +import type { RendererFrontmatterInfo } from '../common/note-frontmatter/types' import { useRendererToEditorCommunicator } from '../editor-page/render-context/renderer-to-editor-communicator-context-provider' import { useRendererReceiveHandler } from './window-post-message-communicator/hooks/use-renderer-receive-handler' import { SlideshowMarkdownRenderer } from '../markdown-renderer/slideshow-markdown-renderer' diff --git a/src/components/render-page/markdown-document.tsx b/src/components/render-page/markdown-document.tsx index 032199232..3c96d562c 100644 --- a/src/components/render-page/markdown-document.tsx +++ b/src/components/render-page/markdown-document.tsx @@ -4,19 +4,20 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { TocAst } from 'markdown-it-toc-done-right' -import React, { MutableRefObject, useEffect, useMemo, useRef, useState } from 'react' +import type { TocAst } from 'markdown-it-toc-done-right' +import type { MutableRefObject } from 'react' +import React, { useEffect, useMemo, useRef, useState } from 'react' import useResizeObserver from 'use-resize-observer' import { YamlArrayDeprecationAlert } from '../editor-page/renderer-pane/yaml-array-deprecation-alert' import { useDocumentSyncScrolling } from './hooks/sync-scroll/use-document-sync-scrolling' -import { ScrollProps } from '../editor-page/synced-scroll/scroll-props' +import type { ScrollProps } from '../editor-page/synced-scroll/scroll-props' import { DocumentMarkdownRenderer } from '../markdown-renderer/document-markdown-renderer' -import { ImageClickHandler } from '../markdown-renderer/replace-components/image/image-replacer' +import type { ImageClickHandler } from '../markdown-renderer/replace-components/image/image-replacer' import './markdown-document.scss' import { WidthBasedTableOfContents } from './width-based-table-of-contents' import { ShowIf } from '../common/show-if/show-if' import { useApplicationState } from '../../hooks/common/use-application-state' -import { RendererFrontmatterInfo } from '../common/note-frontmatter/types' +import type { RendererFrontmatterInfo } from '../common/note-frontmatter/types' import { InvalidYamlAlert } from '../markdown-renderer/invalid-yaml-alert' export interface RendererProps extends ScrollProps { diff --git a/src/components/render-page/markdown-toc-button/table-of-contents-hovering-button.tsx b/src/components/render-page/markdown-toc-button/table-of-contents-hovering-button.tsx index 9ba2fa225..254ae0a5f 100644 --- a/src/components/render-page/markdown-toc-button/table-of-contents-hovering-button.tsx +++ b/src/components/render-page/markdown-toc-button/table-of-contents-hovering-button.tsx @@ -6,7 +6,7 @@ import React from 'react' import { Dropdown } from 'react-bootstrap' -import { TocAst } from 'markdown-it-toc-done-right' +import type { TocAst } from 'markdown-it-toc-done-right' import { ForkAwesomeIcon } from '../../common/fork-awesome/fork-awesome-icon' import { TableOfContents } from '../../editor-page/table-of-contents/table-of-contents' import './markdown-toc-button.scss' diff --git a/src/components/render-page/width-based-table-of-contents.tsx b/src/components/render-page/width-based-table-of-contents.tsx index 84c427bee..860498514 100644 --- a/src/components/render-page/width-based-table-of-contents.tsx +++ b/src/components/render-page/width-based-table-of-contents.tsx @@ -5,7 +5,7 @@ */ import React from 'react' -import { TocAst } from 'markdown-it-toc-done-right' +import type { TocAst } from 'markdown-it-toc-done-right' import { TableOfContents } from '../editor-page/table-of-contents/table-of-contents' import { TableOfContentsHoveringButton } from './markdown-toc-button/table-of-contents-hovering-button' diff --git a/src/components/render-page/window-post-message-communicator/editor-to-renderer-communicator.ts b/src/components/render-page/window-post-message-communicator/editor-to-renderer-communicator.ts index f36a8d3de..e2cf85ac9 100644 --- a/src/components/render-page/window-post-message-communicator/editor-to-renderer-communicator.ts +++ b/src/components/render-page/window-post-message-communicator/editor-to-renderer-communicator.ts @@ -5,7 +5,11 @@ */ import { WindowPostMessageCommunicator } from './window-post-message-communicator' -import { CommunicationMessages, EditorToRendererMessageType, RendererToEditorMessageType } from './rendering-message' +import type { + CommunicationMessages, + EditorToRendererMessageType, + RendererToEditorMessageType +} from './rendering-message' import { Logger } from '../../../utils/logger' /** diff --git a/src/components/render-page/window-post-message-communicator/hooks/use-editor-receive-handler.ts b/src/components/render-page/window-post-message-communicator/hooks/use-editor-receive-handler.ts index fafe952e5..9ca0adc1a 100644 --- a/src/components/render-page/window-post-message-communicator/hooks/use-editor-receive-handler.ts +++ b/src/components/render-page/window-post-message-communicator/hooks/use-editor-receive-handler.ts @@ -5,9 +5,9 @@ */ import { useEffect } from 'react' -import { CommunicationMessages, RendererToEditorMessageType } from '../rendering-message' +import type { CommunicationMessages, RendererToEditorMessageType } from '../rendering-message' import { useEditorToRendererCommunicator } from '../../../editor-page/render-context/editor-to-renderer-communicator-context-provider' -import { Handler } from '../window-post-message-communicator' +import type { Handler } from '../window-post-message-communicator' /** * Sets the handler for the given message type in the current editor to renderer communicator. diff --git a/src/components/render-page/window-post-message-communicator/hooks/use-renderer-receive-handler.ts b/src/components/render-page/window-post-message-communicator/hooks/use-renderer-receive-handler.ts index 3a813c264..d8ae29491 100644 --- a/src/components/render-page/window-post-message-communicator/hooks/use-renderer-receive-handler.ts +++ b/src/components/render-page/window-post-message-communicator/hooks/use-renderer-receive-handler.ts @@ -5,8 +5,8 @@ */ import { useEffect } from 'react' -import { CommunicationMessages, EditorToRendererMessageType } from '../rendering-message' -import { Handler } from '../window-post-message-communicator' +import type { CommunicationMessages, EditorToRendererMessageType } from '../rendering-message' +import type { Handler } from '../window-post-message-communicator' import { useRendererToEditorCommunicator } from '../../../editor-page/render-context/renderer-to-editor-communicator-context-provider' /** diff --git a/src/components/render-page/window-post-message-communicator/hooks/use-send-to-renderer.ts b/src/components/render-page/window-post-message-communicator/hooks/use-send-to-renderer.ts index c6f4bbf2d..2037ef98c 100644 --- a/src/components/render-page/window-post-message-communicator/hooks/use-send-to-renderer.ts +++ b/src/components/render-page/window-post-message-communicator/hooks/use-send-to-renderer.ts @@ -5,9 +5,9 @@ */ import { useCallback } from 'react' -import { CommunicationMessages, EditorToRendererMessageType } from '../rendering-message' +import type { CommunicationMessages, EditorToRendererMessageType } from '../rendering-message' import { useEditorToRendererCommunicator } from '../../../editor-page/render-context/editor-to-renderer-communicator-context-provider' -import { PostMessage } from '../window-post-message-communicator' +import type { PostMessage } from '../window-post-message-communicator' import { useEffectOnRendererReady } from './use-effect-on-renderer-ready' export const useSendToRenderer = ( diff --git a/src/components/render-page/window-post-message-communicator/renderer-to-editor-communicator.ts b/src/components/render-page/window-post-message-communicator/renderer-to-editor-communicator.ts index cfd0e1212..dc720d1e7 100644 --- a/src/components/render-page/window-post-message-communicator/renderer-to-editor-communicator.ts +++ b/src/components/render-page/window-post-message-communicator/renderer-to-editor-communicator.ts @@ -5,7 +5,11 @@ */ import { WindowPostMessageCommunicator } from './window-post-message-communicator' -import { CommunicationMessages, EditorToRendererMessageType, RendererToEditorMessageType } from './rendering-message' +import type { + CommunicationMessages, + EditorToRendererMessageType, + RendererToEditorMessageType +} from './rendering-message' import { Logger } from '../../../utils/logger' /** diff --git a/src/components/render-page/window-post-message-communicator/rendering-message.ts b/src/components/render-page/window-post-message-communicator/rendering-message.ts index 3b6e156ab..46a509471 100644 --- a/src/components/render-page/window-post-message-communicator/rendering-message.ts +++ b/src/components/render-page/window-post-message-communicator/rendering-message.ts @@ -3,8 +3,8 @@ * * SPDX-License-Identifier: AGPL-3.0-only */ -import { ScrollState } from '../../editor-page/synced-scroll/scroll-props' -import { RendererFrontmatterInfo } from '../../common/note-frontmatter/types' +import type { ScrollState } from '../../editor-page/synced-scroll/scroll-props' +import type { RendererFrontmatterInfo } from '../../common/note-frontmatter/types' export enum CommunicationMessageType { SET_MARKDOWN_CONTENT = 'SET_MARKDOWN_CONTENT', diff --git a/src/components/render-page/window-post-message-communicator/window-post-message-communicator.ts b/src/components/render-page/window-post-message-communicator/window-post-message-communicator.ts index 5239a2a18..4d36379db 100644 --- a/src/components/render-page/window-post-message-communicator/window-post-message-communicator.ts +++ b/src/components/render-page/window-post-message-communicator/window-post-message-communicator.ts @@ -4,7 +4,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { Logger } from '../../../utils/logger' +import type { Logger } from '../../../utils/logger' /** * Error that will be thrown if a message couldn't be sent. diff --git a/src/external-types/markdown-it-abbr/index.d.ts b/src/external-types/markdown-it-abbr/index.d.ts index 3ec9a467a..2e77f3bd0 100644 --- a/src/external-types/markdown-it-abbr/index.d.ts +++ b/src/external-types/markdown-it-abbr/index.d.ts @@ -5,7 +5,7 @@ */ declare module 'markdown-it-abbr' { - import MarkdownIt from 'markdown-it/lib' + import type MarkdownIt from 'markdown-it/lib' const markdownItAbbreviation: MarkdownIt.PluginSimple export = markdownItAbbreviation } diff --git a/src/external-types/markdown-it-deflist/index.d.ts b/src/external-types/markdown-it-deflist/index.d.ts index b03c8a418..0ed2c78fb 100644 --- a/src/external-types/markdown-it-deflist/index.d.ts +++ b/src/external-types/markdown-it-deflist/index.d.ts @@ -5,7 +5,7 @@ */ declare module 'markdown-it-deflist' { - import MarkdownIt from 'markdown-it/lib' + import type MarkdownIt from 'markdown-it/lib' const markdownItDefinitionList: MarkdownIt.PluginSimple export = markdownItDefinitionList } diff --git a/src/external-types/markdown-it-emoji/index.d.ts b/src/external-types/markdown-it-emoji/index.d.ts index 93ae4bf93..e29c34f59 100644 --- a/src/external-types/markdown-it-emoji/index.d.ts +++ b/src/external-types/markdown-it-emoji/index.d.ts @@ -5,8 +5,8 @@ */ declare module 'markdown-it-emoji/bare' { - import MarkdownIt from 'markdown-it/lib' - import { EmojiOptions } from './interface' + import type MarkdownIt from 'markdown-it/lib' + import type { EmojiOptions } from './interface' const markdownItEmoji: MarkdownIt.PluginWithOptions export = markdownItEmoji } diff --git a/src/external-types/markdown-it-footnote/index.d.ts b/src/external-types/markdown-it-footnote/index.d.ts index fa36e0257..57f71f609 100644 --- a/src/external-types/markdown-it-footnote/index.d.ts +++ b/src/external-types/markdown-it-footnote/index.d.ts @@ -5,7 +5,7 @@ */ declare module 'markdown-it-footnote' { - import MarkdownIt from 'markdown-it/lib' + import type MarkdownIt from 'markdown-it/lib' const markdownItFootnote: MarkdownIt.PluginSimple export = markdownItFootnote } diff --git a/src/external-types/markdown-it-ins/index.d.ts b/src/external-types/markdown-it-ins/index.d.ts index a126b6dd9..35bda8223 100644 --- a/src/external-types/markdown-it-ins/index.d.ts +++ b/src/external-types/markdown-it-ins/index.d.ts @@ -5,7 +5,7 @@ */ declare module 'markdown-it-ins' { - import MarkdownIt from 'markdown-it/lib' + import type MarkdownIt from 'markdown-it/lib' const markdownItInserted: MarkdownIt.PluginSimple export = markdownItInserted } diff --git a/src/external-types/markdown-it-linkify/index.d.ts b/src/external-types/markdown-it-linkify/index.d.ts index 1e83a638b..df4fb21f4 100644 --- a/src/external-types/markdown-it-linkify/index.d.ts +++ b/src/external-types/markdown-it-linkify/index.d.ts @@ -5,7 +5,7 @@ */ declare module 'markdown-it/lib/rules_core/linkify' { - import { RuleCore } from 'markdown-it/lib/parser_core' + import type { RuleCore } from 'markdown-it/lib/parser_core' const markdownItLinkify: RuleCore export = markdownItLinkify } diff --git a/src/external-types/markdown-it-mark/index.d.ts b/src/external-types/markdown-it-mark/index.d.ts index 88f5d2630..88da205b1 100644 --- a/src/external-types/markdown-it-mark/index.d.ts +++ b/src/external-types/markdown-it-mark/index.d.ts @@ -5,7 +5,7 @@ */ declare module 'markdown-it-mark' { - import MarkdownIt from 'markdown-it/lib' + import type MarkdownIt from 'markdown-it/lib' const markdownItMark: MarkdownIt.PluginSimple export = markdownItMark } diff --git a/src/external-types/markdown-it-mathjax/index.d.ts b/src/external-types/markdown-it-mathjax/index.d.ts index e05d1cb9b..2c9c87d4b 100644 --- a/src/external-types/markdown-it-mathjax/index.d.ts +++ b/src/external-types/markdown-it-mathjax/index.d.ts @@ -5,7 +5,7 @@ */ declare module 'markdown-it-mathjax' { - import MarkdownIt from 'markdown-it/lib' + import type MarkdownIt from 'markdown-it/lib' const markdownItMathJax: (MathJaxOptions) => MarkdownIt.PluginSimple export = markdownItMathJax } diff --git a/src/external-types/markdown-it-regex/index.d.ts b/src/external-types/markdown-it-regex/index.d.ts index 34714dfe5..5f3c1eb7b 100644 --- a/src/external-types/markdown-it-regex/index.d.ts +++ b/src/external-types/markdown-it-regex/index.d.ts @@ -5,8 +5,8 @@ */ declare module 'markdown-it-regex' { - import MarkdownIt from 'markdown-it/lib' - import { RegexOptions } from './interface' + import type MarkdownIt from 'markdown-it/lib' + import type { RegexOptions } from './interface' const markdownItRegex: MarkdownIt.PluginWithOptions export = markdownItRegex } diff --git a/src/external-types/markdown-it-sub/index.d.ts b/src/external-types/markdown-it-sub/index.d.ts index f85100200..1c6dcf7ae 100644 --- a/src/external-types/markdown-it-sub/index.d.ts +++ b/src/external-types/markdown-it-sub/index.d.ts @@ -5,7 +5,7 @@ */ declare module 'markdown-it-sub' { - import MarkdownIt from 'markdown-it/lib' + import type MarkdownIt from 'markdown-it/lib' const markdownItSubscript: MarkdownIt.PluginSimple export = markdownItSubscript } diff --git a/src/external-types/markdown-it-sup/index.d.ts b/src/external-types/markdown-it-sup/index.d.ts index 8b5cd8820..1154d9679 100644 --- a/src/external-types/markdown-it-sup/index.d.ts +++ b/src/external-types/markdown-it-sup/index.d.ts @@ -5,7 +5,7 @@ */ declare module 'markdown-it-sup' { - import MarkdownIt from 'markdown-it/lib' + import type MarkdownIt from 'markdown-it/lib' const markdownItSuperscript: MarkdownIt.PluginSimple export = markdownItSuperscript } diff --git a/src/hooks/common/use-application-state.ts b/src/hooks/common/use-application-state.ts index 7601ff640..2abcf1540 100644 --- a/src/hooks/common/use-application-state.ts +++ b/src/hooks/common/use-application-state.ts @@ -5,7 +5,7 @@ */ import { useSelector } from 'react-redux' -import { ApplicationState } from '../../redux' +import type { ApplicationState } from '../../redux' import equal from 'fast-deep-equal' /** diff --git a/src/redux/api-url/methods.ts b/src/redux/api-url/methods.ts index aa40610c8..aae7848bd 100644 --- a/src/redux/api-url/methods.ts +++ b/src/redux/api-url/methods.ts @@ -5,7 +5,8 @@ */ import { store } from '..' -import { ApiUrlActionType, ApiUrlObject, SetApiUrlAction } from './types' +import type { ApiUrlObject, SetApiUrlAction } from './types' +import { ApiUrlActionType } from './types' export const setApiUrl = (state: ApiUrlObject): void => { store.dispatch({ diff --git a/src/redux/api-url/reducers.ts b/src/redux/api-url/reducers.ts index 7185f6bc8..70a6c9a44 100644 --- a/src/redux/api-url/reducers.ts +++ b/src/redux/api-url/reducers.ts @@ -4,8 +4,9 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { Reducer } from 'redux' -import { ApiUrlActions, ApiUrlActionType, ApiUrlObject } from './types' +import type { Reducer } from 'redux' +import type { ApiUrlActions, ApiUrlObject } from './types' +import { ApiUrlActionType } from './types' export const initialState: ApiUrlObject = { apiUrl: '' diff --git a/src/redux/api-url/types.ts b/src/redux/api-url/types.ts index 1484b97bb..4203c9cd5 100644 --- a/src/redux/api-url/types.ts +++ b/src/redux/api-url/types.ts @@ -4,7 +4,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { Action } from 'redux' +import type { Action } from 'redux' export enum ApiUrlActionType { SET_API_URL = 'api-url/set' diff --git a/src/redux/config/methods.ts b/src/redux/config/methods.ts index 364a5ed8d..0e5f04a50 100644 --- a/src/redux/config/methods.ts +++ b/src/redux/config/methods.ts @@ -5,8 +5,9 @@ */ import { store } from '..' -import { Config } from '../../api/config/types' -import { ConfigActionType, SetConfigAction } from './types' +import type { Config } from '../../api/config/types' +import type { SetConfigAction } from './types' +import { ConfigActionType } from './types' export const setConfig = (state: Config): void => { store.dispatch({ diff --git a/src/redux/config/reducers.ts b/src/redux/config/reducers.ts index 3bf63970d..3bcc62ba4 100644 --- a/src/redux/config/reducers.ts +++ b/src/redux/config/reducers.ts @@ -4,9 +4,10 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { Reducer } from 'redux' -import { Config } from '../../api/config/types' -import { ConfigActions, ConfigActionType } from './types' +import type { Reducer } from 'redux' +import type { Config } from '../../api/config/types' +import type { ConfigActions } from './types' +import { ConfigActionType } from './types' export const initialState: Config = { allowAnonymous: true, diff --git a/src/redux/config/types.ts b/src/redux/config/types.ts index 87084ec75..11721d690 100644 --- a/src/redux/config/types.ts +++ b/src/redux/config/types.ts @@ -4,8 +4,8 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { Action } from 'redux' -import { Config } from '../../api/config/types' +import type { Action } from 'redux' +import type { Config } from '../../api/config/types' export enum ConfigActionType { SET_CONFIG = 'config/set' diff --git a/src/redux/dark-mode/methods.ts b/src/redux/dark-mode/methods.ts index 74363c8c5..100ce0829 100644 --- a/src/redux/dark-mode/methods.ts +++ b/src/redux/dark-mode/methods.ts @@ -5,7 +5,8 @@ */ import { store } from '..' -import { DarkModeConfig, DarkModeConfigActionType, SetDarkModeConfigAction } from './types' +import type { DarkModeConfig, SetDarkModeConfigAction } from './types' +import { DarkModeConfigActionType } from './types' import { Logger } from '../../utils/logger' const log = new Logger('Redux > DarkMode') diff --git a/src/redux/dark-mode/reducers.ts b/src/redux/dark-mode/reducers.ts index 140be13cc..97748b5bd 100644 --- a/src/redux/dark-mode/reducers.ts +++ b/src/redux/dark-mode/reducers.ts @@ -4,9 +4,10 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { Reducer } from 'redux' +import type { Reducer } from 'redux' import { determineDarkModeBrowserSetting, loadFromLocalStorage, saveToLocalStorage } from './methods' -import { DarkModeConfig, DarkModeConfigActions, DarkModeConfigActionType } from './types' +import type { DarkModeConfig, DarkModeConfigActions } from './types' +import { DarkModeConfigActionType } from './types' export const getInitialState = (): DarkModeConfig => { const initialMode = loadFromLocalStorage() ?? diff --git a/src/redux/dark-mode/types.ts b/src/redux/dark-mode/types.ts index 4af80572e..1e98246f9 100644 --- a/src/redux/dark-mode/types.ts +++ b/src/redux/dark-mode/types.ts @@ -4,7 +4,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { Action } from 'redux' +import type { Action } from 'redux' export enum DarkModeConfigActionType { SET_DARK_MODE = 'dark-mode/set' diff --git a/src/redux/editor/methods.ts b/src/redux/editor/methods.ts index e67a4aab1..573946971 100644 --- a/src/redux/editor/methods.ts +++ b/src/redux/editor/methods.ts @@ -4,18 +4,18 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { EditorConfiguration } from 'codemirror' +import type { EditorConfiguration } from 'codemirror' import { store } from '..' -import { EditorMode } from '../../components/editor-page/app-bar/editor-view-mode' -import { +import type { EditorMode } from '../../components/editor-page/app-bar/editor-view-mode' +import type { EditorConfig, - EditorConfigActionType, SetEditorLigaturesAction, SetEditorPreferencesAction, SetEditorSmartPasteAction, SetEditorSyncScrollAction, SetEditorViewModeAction } from './types' +import { EditorConfigActionType } from './types' import { Logger } from '../../utils/logger' const log = new Logger('Redux > Editor') diff --git a/src/redux/editor/reducers.ts b/src/redux/editor/reducers.ts index 847d3ac0e..e55e4dddf 100644 --- a/src/redux/editor/reducers.ts +++ b/src/redux/editor/reducers.ts @@ -4,10 +4,11 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { Reducer } from 'redux' +import type { Reducer } from 'redux' import { EditorMode } from '../../components/editor-page/app-bar/editor-view-mode' import { loadFromLocalStorage, saveToLocalStorage } from './methods' -import { EditorConfig, EditorConfigActions, EditorConfigActionType } from './types' +import type { EditorConfig, EditorConfigActions } from './types' +import { EditorConfigActionType } from './types' const initialState: EditorConfig = { editorMode: EditorMode.BOTH, diff --git a/src/redux/editor/types.ts b/src/redux/editor/types.ts index c9359432a..8e577404e 100644 --- a/src/redux/editor/types.ts +++ b/src/redux/editor/types.ts @@ -4,9 +4,9 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { EditorConfiguration } from 'codemirror' -import { Action } from 'redux' -import { EditorMode } from '../../components/editor-page/app-bar/editor-view-mode' +import type { EditorConfiguration } from 'codemirror' +import type { Action } from 'redux' +import type { EditorMode } from '../../components/editor-page/app-bar/editor-view-mode' export enum EditorConfigActionType { SET_EDITOR_VIEW_MODE = 'editor/view-mode/set', diff --git a/src/redux/history/methods.ts b/src/redux/history/methods.ts index 443c9f3e1..80ea381a4 100644 --- a/src/redux/history/methods.ts +++ b/src/redux/history/methods.ts @@ -5,16 +5,15 @@ */ import { store } from '../index' -import { - HistoryActionType, +import type { HistoryEntry, - HistoryEntryOrigin, HistoryExportJson, RemoveEntryAction, SetEntriesAction, UpdateEntryAction, V1HistoryEntry } from './types' +import { HistoryActionType, HistoryEntryOrigin } from './types' import { download } from '../../components/common/download/download' import { DateTime } from 'luxon' import { diff --git a/src/redux/history/reducers.ts b/src/redux/history/reducers.ts index fe14104f0..5b4ec8ae9 100644 --- a/src/redux/history/reducers.ts +++ b/src/redux/history/reducers.ts @@ -4,8 +4,9 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { Reducer } from 'redux' -import { HistoryActions, HistoryActionType, HistoryEntry } from './types' +import type { Reducer } from 'redux' +import type { HistoryActions, HistoryEntry } from './types' +import { HistoryActionType } from './types' // Q: Why is the reducer initialized with an empty array instead of the actual history entries like in the config reducer? // A: The history reducer will be created without entries because of async entry retrieval. diff --git a/src/redux/history/types.ts b/src/redux/history/types.ts index 4a26f1734..19ce3b17c 100644 --- a/src/redux/history/types.ts +++ b/src/redux/history/types.ts @@ -4,7 +4,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { Action } from 'redux' +import type { Action } from 'redux' export enum HistoryEntryOrigin { LOCAL, diff --git a/src/redux/index.ts b/src/redux/index.ts index 9851d3257..cfc2f3cbe 100644 --- a/src/redux/index.ts +++ b/src/redux/index.ts @@ -4,27 +4,28 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { combineReducers, createStore, Reducer } from 'redux' -import { Config } from '../api/config/types' +import type { Reducer } from 'redux' +import { combineReducers, createStore } from 'redux' +import type { Config } from '../api/config/types' import { ApiUrlReducer } from './api-url/reducers' -import { ApiUrlObject } from './api-url/types' +import type { ApiUrlObject } from './api-url/types' import { MotdReducer } from './motd/reducers' -import { OptionalMotdState } from './motd/types' +import type { OptionalMotdState } from './motd/types' import { ConfigReducer } from './config/reducers' import { DarkModeConfigReducer } from './dark-mode/reducers' -import { DarkModeConfig } from './dark-mode/types' +import type { DarkModeConfig } from './dark-mode/types' import { EditorConfigReducer } from './editor/reducers' -import { EditorConfig } from './editor/types' +import type { EditorConfig } from './editor/types' import { NoteDetailsReducer } from './note-details/reducer' -import { NoteDetails } from './note-details/types' +import type { NoteDetails } from './note-details/types' import { UserReducer } from './user/reducers' -import { OptionalUserState } from './user/types' -import { UiNotificationState } from './ui-notifications/types' +import type { OptionalUserState } from './user/types' +import type { UiNotificationState } from './ui-notifications/types' import { UiNotificationReducer } from './ui-notifications/reducers' -import { HistoryEntry } from './history/types' +import type { HistoryEntry } from './history/types' import { HistoryReducer } from './history/reducers' import { RendererStatusReducer } from './renderer-status/reducers' -import { RendererStatus } from './renderer-status/types' +import type { RendererStatus } from './renderer-status/types' import { composeWithDevTools } from 'redux-devtools-extension/developmentOnly' export interface ApplicationState { diff --git a/src/redux/motd/methods.ts b/src/redux/motd/methods.ts index 098860c07..f89fe8e12 100644 --- a/src/redux/motd/methods.ts +++ b/src/redux/motd/methods.ts @@ -5,7 +5,8 @@ */ import { store } from '..' -import { DismissMotdAction, MotdActionType, SetMotdAction } from './types' +import type { DismissMotdAction, SetMotdAction } from './types' +import { MotdActionType } from './types' /** * Sets a not-dismissed motd message in the global application state. diff --git a/src/redux/motd/reducers.ts b/src/redux/motd/reducers.ts index 34b470720..dc7cecd9a 100644 --- a/src/redux/motd/reducers.ts +++ b/src/redux/motd/reducers.ts @@ -4,8 +4,9 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { Reducer } from 'redux' -import { MotdActions, MotdActionType, MotdState, OptionalMotdState } from './types' +import type { Reducer } from 'redux' +import type { MotdActions, MotdState, OptionalMotdState } from './types' +import { MotdActionType } from './types' import { MOTD_LOCAL_STORAGE_KEY } from '../../components/application-loader/initializers/fetch-motd' /** diff --git a/src/redux/motd/types.ts b/src/redux/motd/types.ts index 338bd44e2..845952be7 100644 --- a/src/redux/motd/types.ts +++ b/src/redux/motd/types.ts @@ -4,7 +4,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { Action } from 'redux' +import type { Action } from 'redux' export enum MotdActionType { SET_MOTD = 'motd/set', diff --git a/src/redux/note-details/initial-state.ts b/src/redux/note-details/initial-state.ts index 273d0aae7..36b1ef386 100644 --- a/src/redux/note-details/initial-state.ts +++ b/src/redux/note-details/initial-state.ts @@ -4,9 +4,10 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { NoteDetails } from './types' +import type { NoteDetails } from './types' import { DateTime } from 'luxon' -import { NoteTextDirection, NoteType, SlideOptions } from '../../components/common/note-frontmatter/types' +import type { SlideOptions } from '../../components/common/note-frontmatter/types' +import { NoteTextDirection, NoteType } from '../../components/common/note-frontmatter/types' export const initialSlideOptions: SlideOptions = { transition: 'zoom', diff --git a/src/redux/note-details/methods.ts b/src/redux/note-details/methods.ts index cabf50963..fed5eef1b 100644 --- a/src/redux/note-details/methods.ts +++ b/src/redux/note-details/methods.ts @@ -5,14 +5,14 @@ */ import { store } from '..' -import { NoteDto } from '../../api/notes/types' -import { - NoteDetailsActionType, +import type { NoteDto } from '../../api/notes/types' +import type { SetNoteDetailsFromServerAction, SetNoteDocumentContentAction, UpdateNoteTitleByFirstHeadingAction, UpdateTaskListCheckboxAction } from './types' +import { NoteDetailsActionType } from './types' /** * Sets the content of the current note, extracts and parses the frontmatter and extracts the markdown content part. diff --git a/src/redux/note-details/reducer.ts b/src/redux/note-details/reducer.ts index 03a648c7f..5ad261eb7 100644 --- a/src/redux/note-details/reducer.ts +++ b/src/redux/note-details/reducer.ts @@ -4,15 +4,14 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { Reducer } from 'redux' -import { PresentFrontmatterExtractionResult } from '../../components/common/note-frontmatter/types' -import { - createNoteFrontmatterFromYaml, - NoteFrontmatter -} from '../../components/common/note-frontmatter/note-frontmatter' -import { NoteDetails, NoteDetailsActions, NoteDetailsActionType } from './types' +import type { Reducer } from 'redux' +import type { PresentFrontmatterExtractionResult } from '../../components/common/note-frontmatter/types' +import type { NoteFrontmatter } from '../../components/common/note-frontmatter/note-frontmatter' +import { createNoteFrontmatterFromYaml } from '../../components/common/note-frontmatter/note-frontmatter' +import type { NoteDetails, NoteDetailsActions } from './types' +import { NoteDetailsActionType } from './types' import { extractFrontmatter } from '../../components/common/note-frontmatter/extract-frontmatter' -import { NoteDto } from '../../api/notes/types' +import type { NoteDto } from '../../api/notes/types' import { initialState } from './initial-state' import { DateTime } from 'luxon' diff --git a/src/redux/note-details/types.ts b/src/redux/note-details/types.ts index 8ddeca91a..721e93f35 100644 --- a/src/redux/note-details/types.ts +++ b/src/redux/note-details/types.ts @@ -4,11 +4,11 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { DateTime } from 'luxon' -import { Action } from 'redux' -import { NoteFrontmatter } from '../../components/common/note-frontmatter/note-frontmatter' -import { NoteDto } from '../../api/notes/types' -import { RendererFrontmatterInfo } from '../../components/common/note-frontmatter/types' +import type { DateTime } from 'luxon' +import type { Action } from 'redux' +import type { NoteFrontmatter } from '../../components/common/note-frontmatter/note-frontmatter' +import type { NoteDto } from '../../api/notes/types' +import type { RendererFrontmatterInfo } from '../../components/common/note-frontmatter/types' export enum NoteDetailsActionType { SET_DOCUMENT_CONTENT = 'note-details/content/set', diff --git a/src/redux/renderer-status/methods.ts b/src/redux/renderer-status/methods.ts index 015f5c108..de5928d9e 100644 --- a/src/redux/renderer-status/methods.ts +++ b/src/redux/renderer-status/methods.ts @@ -5,7 +5,8 @@ */ import { store } from '..' -import { RendererStatusActionType, SetRendererStatusAction } from './types' +import type { SetRendererStatusAction } from './types' +import { RendererStatusActionType } from './types' /** * Dispatches a global application state change for the "renderer ready" state. diff --git a/src/redux/renderer-status/reducers.ts b/src/redux/renderer-status/reducers.ts index ac60a56e0..1325ea852 100644 --- a/src/redux/renderer-status/reducers.ts +++ b/src/redux/renderer-status/reducers.ts @@ -4,8 +4,9 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { RendererStatus, RendererStatusActions, RendererStatusActionType } from './types' -import { Reducer } from 'redux' +import type { RendererStatus, RendererStatusActions } from './types' +import { RendererStatusActionType } from './types' +import type { Reducer } from 'redux' const initialState: RendererStatus = { rendererReady: false diff --git a/src/redux/renderer-status/types.ts b/src/redux/renderer-status/types.ts index a006f84ee..e0b344f21 100644 --- a/src/redux/renderer-status/types.ts +++ b/src/redux/renderer-status/types.ts @@ -4,7 +4,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { Action } from 'redux' +import type { Action } from 'redux' export enum RendererStatusActionType { SET_RENDERER_STATUS = 'renderer-status/set-ready' diff --git a/src/redux/ui-notifications/methods.ts b/src/redux/ui-notifications/methods.ts index fb50f231f..9f3dd95c1 100644 --- a/src/redux/ui-notifications/methods.ts +++ b/src/redux/ui-notifications/methods.ts @@ -4,9 +4,11 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import i18n, { TOptions } from 'i18next' +import type { TOptions } from 'i18next' +import i18n from 'i18next' import { store } from '../index' -import { DismissUiNotificationAction, DispatchOptions, UiNotificationActionType } from './types' +import type { DismissUiNotificationAction, DispatchOptions } from './types' +import { UiNotificationActionType } from './types' import { DateTime } from 'luxon' import { Logger } from '../../utils/logger' diff --git a/src/redux/ui-notifications/reducers.ts b/src/redux/ui-notifications/reducers.ts index 747f3fa21..802aca0a3 100644 --- a/src/redux/ui-notifications/reducers.ts +++ b/src/redux/ui-notifications/reducers.ts @@ -4,8 +4,9 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { Reducer } from 'redux' -import { UiNotification, UiNotificationActions, UiNotificationActionType, UiNotificationState } from './types' +import type { Reducer } from 'redux' +import type { UiNotification, UiNotificationActions, UiNotificationState } from './types' +import { UiNotificationActionType } from './types' export const UiNotificationReducer: Reducer = ( state: UiNotificationState = [], diff --git a/src/redux/ui-notifications/types.ts b/src/redux/ui-notifications/types.ts index c4188fa9b..a208fda82 100644 --- a/src/redux/ui-notifications/types.ts +++ b/src/redux/ui-notifications/types.ts @@ -4,10 +4,10 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { Action } from 'redux' -import { DateTime } from 'luxon' -import { IconName } from '../../components/common/fork-awesome/types' -import { TOptions } from 'i18next' +import type { Action } from 'redux' +import type { DateTime } from 'luxon' +import type { IconName } from '../../components/common/fork-awesome/types' +import type { TOptions } from 'i18next' export enum UiNotificationActionType { DISPATCH_NOTIFICATION = 'notification/dispatch', diff --git a/src/redux/user/methods.ts b/src/redux/user/methods.ts index 64f8497d8..e59aff877 100644 --- a/src/redux/user/methods.ts +++ b/src/redux/user/methods.ts @@ -5,7 +5,8 @@ */ import { store } from '..' -import { ClearUserAction, SetUserAction, UserActionType, UserState } from './types' +import type { ClearUserAction, SetUserAction, UserState } from './types' +import { UserActionType } from './types' export const setUser: (state: UserState) => void = (state: UserState) => { const action: SetUserAction = { diff --git a/src/redux/user/reducers.ts b/src/redux/user/reducers.ts index 96bc2d1b8..74ae51ae8 100644 --- a/src/redux/user/reducers.ts +++ b/src/redux/user/reducers.ts @@ -4,8 +4,9 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { Reducer } from 'redux' -import { OptionalUserState, UserActions, UserActionType } from './types' +import type { Reducer } from 'redux' +import type { OptionalUserState, UserActions } from './types' +import { UserActionType } from './types' export const UserReducer: Reducer = ( state: OptionalUserState = null, diff --git a/src/redux/user/types.ts b/src/redux/user/types.ts index e2334d3ff..06b80123f 100644 --- a/src/redux/user/types.ts +++ b/src/redux/user/types.ts @@ -4,7 +4,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { Action } from 'redux' +import type { Action } from 'redux' export enum UserActionType { SET_USER = 'user/set', diff --git a/yarn.lock b/yarn.lock index ee78d6c27..dcd7a9c4c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3261,7 +3261,7 @@ array-flatten@^2.1.0: resolved "https://registry.yarnpkg.com/array-flatten/-/array-flatten-2.1.2.tgz#24ef80a28c1a893617e2149b0c6d0d788293b099" integrity sha512-hNfzcOV8W4NdualtqBFPyVO+54DSJuZGY9qT4pRroB6S9e3iiido2ISIC5h9R2sPJ8H3FHCIiEnsv1lPXO3KtQ== -array-includes@^3.1.1, array-includes@^3.1.3: +array-includes@^3.1.1, array-includes@^3.1.3, array-includes@^3.1.4: version "3.1.4" resolved "https://registry.yarnpkg.com/array-includes/-/array-includes-3.1.4.tgz#f5b493162c760f3539631f005ba2bb46acb45ba9" integrity sha512-ZTNSQkmWumEbiHO2GF4GmWxYVTiQyJy2XOTa15sdQSrvKn7l+180egQMqlrMOUMCyLMD7pmyQe4mMDUT6Behrw== @@ -3294,7 +3294,7 @@ array-unique@^0.3.2: resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" integrity sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg= -array.prototype.flat@^1.2.4: +array.prototype.flat@^1.2.5: version "1.2.5" resolved "https://registry.yarnpkg.com/array.prototype.flat/-/array.prototype.flat-1.2.5.tgz#07e0975d84bbc7c48cd1879d609e682598d33e13" integrity sha512-KaYU+S+ndVqyUnignHftkwc58o3uVU1jzczILJ1tN2YaIZpFIKBiP/x/j97E5MVPsaCloPbqWLB/8qCTVvT2qg== @@ -6522,7 +6522,7 @@ eslint-import-resolver-node@^0.3.6: debug "^3.2.7" resolve "^1.20.0" -eslint-module-utils@^2.6.2: +eslint-module-utils@^2.7.0: version "2.7.1" resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.7.1.tgz#b435001c9f8dd4ab7f6d0efcae4b9696d4c24b7c" integrity sha512-fjoetBXQZq2tSTWZ9yWVl2KuFrTZZH3V+9iD1V1RfpDgxzJR+mPd/KZmMiA8gbPqdBzpNiEHOuT7IYEWxrH0zQ== @@ -6559,24 +6559,22 @@ eslint-plugin-flowtype@^5.2.0: lodash "^4.17.15" string-natural-compare "^3.0.1" -eslint-plugin-import@2.24.2, eslint-plugin-import@^2.22.1: - version "2.24.2" - resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.24.2.tgz#2c8cd2e341f3885918ee27d18479910ade7bb4da" - integrity sha512-hNVtyhiEtZmpsabL4neEj+6M5DCLgpYyG9nzJY8lZQeQXEn5UPW1DpUdsMHMXsq98dbNm7nt1w9ZMSVpfJdi8Q== +eslint-plugin-import@2.25.2, eslint-plugin-import@^2.22.1: + version "2.25.2" + resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.25.2.tgz#b3b9160efddb702fc1636659e71ba1d10adbe9e9" + integrity sha512-qCwQr9TYfoBHOFcVGKY9C9unq05uOxxdklmBXLVvcwo68y5Hta6/GzCZEMx2zQiu0woKNEER0LE7ZgaOfBU14g== dependencies: - array-includes "^3.1.3" - array.prototype.flat "^1.2.4" + array-includes "^3.1.4" + array.prototype.flat "^1.2.5" debug "^2.6.9" doctrine "^2.1.0" eslint-import-resolver-node "^0.3.6" - eslint-module-utils "^2.6.2" - find-up "^2.0.0" + eslint-module-utils "^2.7.0" has "^1.0.3" - is-core-module "^2.6.0" + is-core-module "^2.7.0" + is-glob "^4.0.3" minimatch "^3.0.4" - object.values "^1.1.4" - pkg-up "^2.0.0" - read-pkg-up "^3.0.0" + object.values "^1.1.5" resolve "^1.20.0" tsconfig-paths "^3.11.0" @@ -7184,7 +7182,7 @@ find-up@4.1.0, find-up@^4.0.0, find-up@^4.1.0: locate-path "^5.0.0" path-exists "^4.0.0" -find-up@^2.0.0, find-up@^2.1.0: +find-up@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7" integrity sha1-RdG35QbHF93UgndaK3eSCjwMV6c= @@ -8295,7 +8293,7 @@ is-color-stop@^1.0.0: rgb-regex "^1.0.1" rgba-regex "^1.0.0" -is-core-module@^2.0.0, is-core-module@^2.2.0, is-core-module@^2.6.0: +is-core-module@^2.0.0, is-core-module@^2.2.0, is-core-module@^2.7.0: version "2.8.0" resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.8.0.tgz#0321336c3d0925e497fd97f5d95cb114a5ccd548" integrity sha512-vd15qHsaqrRL7dtH6QNuy0ndJmRDrS9HAM1CAiSifNUFv4x1a0CCVsj18hJ1mShxIG6T2i1sO78MkP56r0nYRw== @@ -8390,7 +8388,7 @@ is-glob@^3.1.0: dependencies: is-extglob "^2.1.0" -is-glob@^4.0.0, is-glob@^4.0.1, is-glob@~4.0.1: +is-glob@^4.0.0, is-glob@^4.0.1, is-glob@^4.0.3, is-glob@~4.0.1: version "4.0.3" resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== @@ -9382,16 +9380,6 @@ listr2@^3.8.3: through "^2.3.8" wrap-ansi "^7.0.0" -load-json-file@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-4.0.0.tgz#2f5f45ab91e33216234fd53adab668eb4ec0993b" - integrity sha1-L19Fq5HjMhYjT9U62rZo607AmTs= - dependencies: - graceful-fs "^4.1.2" - parse-json "^4.0.0" - pify "^3.0.0" - strip-bom "^3.0.0" - loader-runner@^2.4.0: version "2.4.0" resolved "https://registry.yarnpkg.com/loader-runner/-/loader-runner-2.4.0.tgz#ed47066bfe534d7e84c4c7b9998c2a75607d9357" @@ -10198,7 +10186,7 @@ node-releases@^2.0.0: resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.0.tgz#67dc74903100a7deb044037b8a2e5f453bb05400" integrity sha512-aA87l0flFYMzCHpTM3DERFSYxc6lv/BltdbRTOMZuxZ0cwZCD3mejE5n9vLhSJCN++/eOqr77G1IO5uXxlQYWA== -normalize-package-data@^2.3.2, normalize-package-data@^2.5.0: +normalize-package-data@^2.5.0: version "2.5.0" resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.5.0.tgz#e66db1838b200c1dfc233225d12cb36520e234a8" integrity sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA== @@ -10369,7 +10357,7 @@ object.pick@^1.3.0: dependencies: isobject "^3.0.1" -object.values@^1.1.0, object.values@^1.1.4: +object.values@^1.1.0, object.values@^1.1.4, object.values@^1.1.5: version "1.1.5" resolved "https://registry.yarnpkg.com/object.values/-/object.values-1.1.5.tgz#959f63e3ce9ef108720333082131e4a459b716ac" integrity sha512-QUZRW0ilQ3PnPpbNtgdNV1PDbEqLIiSFB3l+EnGtBQ/8SUTLj1PZwtQHABZtLgwpJZTSZhuGLOGk57Drx2IvYg== @@ -10697,13 +10685,6 @@ path-to-regexp@^1.7.0: dependencies: isarray "0.0.1" -path-type@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/path-type/-/path-type-3.0.0.tgz#cef31dc8e0a1a3bb0d105c0cd97cf3bf47f4e36f" - integrity sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg== - dependencies: - pify "^3.0.0" - path-type@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b" @@ -10750,11 +10731,6 @@ pify@^2.0.0, pify@^2.2.0: resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" integrity sha1-7RQaasBDqEnqWISY59yosVMw6Qw= -pify@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/pify/-/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176" - integrity sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY= - pify@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/pify/-/pify-4.0.1.tgz#4b2cd25c50d598735c50292224fd8c6df41e3231" @@ -10807,13 +10783,6 @@ pkg-up@3.1.0: dependencies: find-up "^3.0.0" -pkg-up@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/pkg-up/-/pkg-up-2.0.0.tgz#c819ac728059a461cab1c3889a2be3c49a004d7f" - integrity sha1-yBmscoBZpGHKscOImivjxJoATX8= - dependencies: - find-up "^2.1.0" - pnp-webpack-plugin@1.6.4: version "1.6.4" resolved "https://registry.yarnpkg.com/pnp-webpack-plugin/-/pnp-webpack-plugin-1.6.4.tgz#c9711ac4dc48a685dabafc86f8b6dd9f8df84149" @@ -12135,14 +12104,6 @@ react@17.0.2, react@^17.0.2: loose-envify "^1.1.0" object-assign "^4.1.1" -read-pkg-up@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-3.0.0.tgz#3ed496685dba0f8fe118d0691dc51f4a1ff96f07" - integrity sha1-PtSWaF26D4/hGNBpHcUfSh/5bwc= - dependencies: - find-up "^2.0.0" - read-pkg "^3.0.0" - read-pkg-up@^7.0.1: version "7.0.1" resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-7.0.1.tgz#f3a6135758459733ae2b95638056e1854e7ef507" @@ -12152,15 +12113,6 @@ read-pkg-up@^7.0.1: read-pkg "^5.2.0" type-fest "^0.8.1" -read-pkg@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-3.0.0.tgz#9cbc686978fee65d16c00e2b19c237fcf6e38389" - integrity sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k= - dependencies: - load-json-file "^4.0.0" - normalize-package-data "^2.3.2" - path-type "^3.0.0" - read-pkg@^5.2.0: version "5.2.0" resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-5.2.0.tgz#7bf295438ca5a33e56cd30e053b34ee7250c93cc"