Skip to content
This repository was archived by the owner on Nov 23, 2022. It is now read-only.

Commit cdb6ad1

Browse files
Merge 42ad161 into fc3a3fa
2 parents fc3a3fa + 42ad161 commit cdb6ad1

File tree

264 files changed

+567
-504
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

264 files changed

+567
-504
lines changed

package.json

+10-4
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"emoji-picker-element": "1.8.2",
4242
"emoji-picker-element-data": "1.2.0",
4343
"eslint-config-react-app": "6.0.0",
44-
"eslint-plugin-import": "2.24.2",
44+
"eslint-plugin-import": "2.25.2",
4545
"eslint-plugin-jsx-a11y": "6.4.1",
4646
"eslint-plugin-node": "11.1.0",
4747
"eslint-plugin-promise": "5.1.0",
@@ -134,7 +134,14 @@
134134
"rules": {
135135
"no-use-before-define": "off",
136136
"no-debugger": "warn",
137-
"default-param-last": "off"
137+
"default-param-last": "off",
138+
"@typescript-eslint/consistent-type-imports": [
139+
"error",
140+
{
141+
"prefer": "type-imports",
142+
"disallowTypeAnnotations": false
143+
}
144+
]
138145
},
139146
"plugins": [
140147
"@typescript-eslint"
@@ -193,7 +200,6 @@
193200
},
194201
"resolutions": {
195202
"cypress": "7.7.0",
196-
"katex": "0.13.18",
197-
"eslint-plugin-import": "2.24.2"
203+
"katex": "0.13.18"
198204
}
199205
}

src/api/config/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66

77
import { defaultFetchConfig, expectResponseCode, getApiUrl } from '../utils'
8-
import { Config } from './types'
8+
import type { Config } from './types'
99

1010
export const getConfig = async (): Promise<Config> => {
1111
const response = await fetch(getApiUrl() + 'config', {

src/api/history/dto-methods.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44
* SPDX-License-Identifier: AGPL-3.0-only
55
*/
66

7-
import { HistoryEntry, HistoryEntryOrigin } from '../../redux/history/types'
8-
import { HistoryEntryDto, HistoryEntryPutDto, HistoryEntryUpdateDto } from './types'
7+
import type { HistoryEntry } from '../../redux/history/types'
8+
import { HistoryEntryOrigin } from '../../redux/history/types'
9+
import type { HistoryEntryDto, HistoryEntryPutDto, HistoryEntryUpdateDto } from './types'
910

1011
export const historyEntryDtoToHistoryEntry = (entryDto: HistoryEntryDto): HistoryEntry => {
1112
return {

src/api/history/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66

77
import { defaultFetchConfig, expectResponseCode, getApiUrl } from '../utils'
8-
import { HistoryEntryDto, HistoryEntryPutDto, HistoryEntryUpdateDto } from './types'
8+
import type { HistoryEntryDto, HistoryEntryPutDto, HistoryEntryUpdateDto } from './types'
99

1010
export const getHistory = async (): Promise<HistoryEntryDto[]> => {
1111
const response = await fetch(getApiUrl() + 'me/history')

src/api/me/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* SPDX-License-Identifier: AGPL-3.0-only
55
*/
66

7-
import { UserResponse } from '../users/types'
7+
import type { UserResponse } from '../users/types'
88
import { defaultFetchConfig, expectResponseCode, getApiUrl } from '../utils'
99
import { isMockMode } from '../../utils/test-modes'
1010

src/api/media/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* SPDX-License-Identifier: AGPL-3.0-only
55
*/
66

7-
import { ImageProxyResponse } from '../../components/markdown-renderer/replace-components/image/types'
7+
import type { ImageProxyResponse } from '../../components/markdown-renderer/replace-components/image/types'
88
import { isMockMode } from '../../utils/test-modes'
99
import { defaultFetchConfig, expectResponseCode, getApiUrl } from '../utils'
1010

src/api/notes/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66

77
import { defaultFetchConfig, expectResponseCode, getApiUrl } from '../utils'
8-
import { NoteDto } from './types'
8+
import type { NoteDto } from './types'
99
import { isMockMode } from '../../utils/test-modes'
1010

1111
export const getNote = async (noteId: string): Promise<NoteDto> => {

src/api/notes/types.d.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
* SPDX-License-Identifier: AGPL-3.0-only
55
*/
66

7-
import { UserInfoDto } from '../users/types'
8-
import { GroupInfoDto } from '../group/types'
7+
import type { UserInfoDto } from '../users/types'
8+
import type { GroupInfoDto } from '../group/types'
99

1010
export interface NoteDto {
1111
content: string

src/api/revisions/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
import { Cache } from '../../components/common/cache/cache'
88
import { defaultFetchConfig, expectResponseCode, getApiUrl } from '../utils'
9-
import { Revision, RevisionListEntry } from './types'
9+
import type { Revision, RevisionListEntry } from './types'
1010

1111
const revisionCache = new Cache<string, Revision>(3600)
1212

src/api/tokens/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66

77
import { defaultFetchConfig, expectResponseCode, getApiUrl } from '../utils'
8-
import { AccessToken, AccessTokenSecret } from './types'
8+
import type { AccessToken, AccessTokenSecret } from './types'
99

1010
export const getAccessTokenList = async (): Promise<AccessToken[]> => {
1111
const response = await fetch(`${getApiUrl()}tokens`, {

src/api/users/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
import { Cache } from '../../components/common/cache/cache'
88
import { defaultFetchConfig, expectResponseCode, getApiUrl } from '../utils'
9-
import { UserResponse } from './types'
9+
import type { UserResponse } from './types'
1010

1111
const cache = new Cache<string, UserResponse>(600)
1212

src/api/users/types.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* SPDX-License-Identifier: AGPL-3.0-only
55
*/
66

7-
import { LoginProvider } from '../../redux/user/types'
7+
import type { LoginProvider } from '../../redux/user/types'
88

99
export interface UserResponse {
1010
id: string

src/components/application-loader/application-loader.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
import React, { Suspense, useCallback, useEffect, useState } from 'react'
88
import { useBackendBaseUrl } from '../../hooks/common/use-backend-base-url'
99
import './application-loader.scss'
10-
import { createSetUpTaskList, InitTask } from './initializers'
10+
import type { InitTask } from './initializers'
11+
import { createSetUpTaskList } from './initializers'
1112
import { LoadingScreen } from './loading-screen'
1213
import { useCustomizeAssetsUrl } from '../../hooks/common/use-customize-assets-url'
1314
import { useFrontendAssetsUrl } from '../../hooks/common/use-frontend-assets-url'

src/components/application-loader/initializers/i18n/i18n.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
* SPDX-License-Identifier: AGPL-3.0-only
55
*/
66

7-
import i18n, { ResourceKey } from 'i18next'
7+
import type { ResourceKey } from 'i18next'
8+
import i18n from 'i18next'
89
import LanguageDetector from 'i18next-browser-languagedetector'
910
import resourcesToBackend from 'i18next-resources-to-backend'
1011
import { Settings } from 'luxon'

src/components/common/copyable/copy-overlay.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
SPDX-License-Identifier: AGPL-3.0-only
55
*/
66

7-
import React, { RefObject, useCallback, useEffect, useState } from 'react'
7+
import type { RefObject } from 'react'
8+
import React, { useCallback, useEffect, useState } from 'react'
89
import { Overlay, Tooltip } from 'react-bootstrap'
910
import { Trans, useTranslation } from 'react-i18next'
1011
import { v4 as uuid } from 'uuid'

src/components/common/copyable/copy-to-clipboard-button/copy-to-clipboard-button.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
import React, { Fragment, useRef } from 'react'
88
import { Button } from 'react-bootstrap'
9-
import { Variant } from 'react-bootstrap/types'
9+
import type { Variant } from 'react-bootstrap/types'
1010
import { useTranslation } from 'react-i18next'
1111
import { ForkAwesomeIcon } from '../../fork-awesome/fork-awesome-icon'
1212
import { CopyOverlay } from '../copy-overlay'

src/components/common/fork-awesome/fork-awesome-icon.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66

77
import React from 'react'
8-
import { IconName, IconSize } from './types'
8+
import type { IconName, IconSize } from './types'
99

1010
export interface ForkAwesomeIconProps {
1111
icon: IconName

src/components/common/fork-awesome/fork-awesome-stack.tsx

+5-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@
44
SPDX-License-Identifier: AGPL-3.0-only
55
*/
66

7-
import React, { ReactElement } from 'react'
8-
import { ForkAwesomeIcon, ForkAwesomeIconProps } from './fork-awesome-icon'
9-
import { IconSize } from './types'
7+
import type { ReactElement } from 'react'
8+
import React from 'react'
9+
import type { ForkAwesomeIconProps } from './fork-awesome-icon'
10+
import { ForkAwesomeIcon } from './fork-awesome-icon'
11+
import type { IconSize } from './types'
1012

1113
export interface ForkAwesomeStackProps {
1214
size?: IconSize

src/components/common/fork-awesome/types.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* SPDX-License-Identifier: AGPL-3.0-only
55
*/
66

7-
import { ForkAwesomeIcons } from './fork-awesome-icons'
7+
import type { ForkAwesomeIcons } from './fork-awesome-icons'
88

99
export type IconName = typeof ForkAwesomeIcons[number]
1010
export type IconSize = '2x' | '3x' | '4x' | '5x'

src/components/common/icon-button/icon-button.tsx

+3-2
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@
55
*/
66

77
import React from 'react'
8-
import { Button, ButtonProps } from 'react-bootstrap'
8+
import type { ButtonProps } from 'react-bootstrap'
9+
import { Button } from 'react-bootstrap'
910
import { ForkAwesomeIcon } from '../fork-awesome/fork-awesome-icon'
10-
import { IconName } from '../fork-awesome/types'
11+
import type { IconName } from '../fork-awesome/types'
1112
import { ShowIf } from '../show-if/show-if'
1213
import './icon-button.scss'
1314

src/components/common/icon-button/translated-icon-button.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66

77
import React from 'react'
88
import { Trans } from 'react-i18next'
9-
import { IconButton, IconButtonProps } from './icon-button'
9+
import type { IconButtonProps } from './icon-button'
10+
import { IconButton } from './icon-button'
1011

1112
export interface TranslatedIconButtonProps extends IconButtonProps {
1213
i18nKey: string

src/components/common/links/external-link.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66

77
import React from 'react'
88
import { ForkAwesomeIcon } from '../fork-awesome/fork-awesome-icon'
9-
import { IconName } from '../fork-awesome/types'
9+
import type { IconName } from '../fork-awesome/types'
1010
import { ShowIf } from '../show-if/show-if'
11-
import { LinkWithTextProps } from './types'
11+
import type { LinkWithTextProps } from './types'
1212

1313
export const ExternalLink: React.FC<LinkWithTextProps> = ({
1414
href,

src/components/common/links/internal-link.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
import React from 'react'
88
import { Link } from 'react-router-dom'
99
import { ForkAwesomeIcon } from '../fork-awesome/fork-awesome-icon'
10-
import { IconName } from '../fork-awesome/types'
10+
import type { IconName } from '../fork-awesome/types'
1111
import { ShowIf } from '../show-if/show-if'
12-
import { LinkWithTextProps } from './types'
12+
import type { LinkWithTextProps } from './types'
1313

1414
export const InternalLink: React.FC<LinkWithTextProps> = ({
1515
href,

src/components/common/links/translated-external-link.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import React from 'react'
88
import { useTranslation } from 'react-i18next'
99
import { ExternalLink } from './external-link'
10-
import { TranslatedLinkProps } from './types'
10+
import type { TranslatedLinkProps } from './types'
1111

1212
export const TranslatedExternalLink: React.FC<TranslatedLinkProps> = ({ i18nKey, i18nOption, ...props }) => {
1313
const { t } = useTranslation()

src/components/common/links/translated-internal-link.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import React from 'react'
88
import { useTranslation } from 'react-i18next'
99
import { InternalLink } from './internal-link'
10-
import { TranslatedLinkProps } from './types'
10+
import type { TranslatedLinkProps } from './types'
1111

1212
export const TranslatedInternalLink: React.FC<TranslatedLinkProps> = ({ i18nKey, i18nOption, ...props }) => {
1313
const { t } = useTranslation()

src/components/common/links/types.d.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
* SPDX-License-Identifier: AGPL-3.0-only
55
*/
66

7-
import { StringMap, TOptionsBase } from 'i18next'
8-
import { IconName } from '../fork-awesome/fork-awesome-icon'
7+
import type { StringMap, TOptionsBase } from 'i18next'
8+
import type { IconName } from '../fork-awesome/fork-awesome-icon'
99

1010
interface GeneralLinkProp {
1111
href: string

src/components/common/modals/common-modal.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import React from 'react'
88
import { Modal } from 'react-bootstrap'
99
import { Trans, useTranslation } from 'react-i18next'
1010
import { ForkAwesomeIcon } from '../fork-awesome/fork-awesome-icon'
11-
import { IconName } from '../fork-awesome/types'
11+
import type { IconName } from '../fork-awesome/types'
1212
import { ShowIf } from '../show-if/show-if'
1313

1414
export interface CommonModalProps {

src/components/common/modals/deletion-modal.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
import React from 'react'
88
import { Button, Modal } from 'react-bootstrap'
99
import { Trans, useTranslation } from 'react-i18next'
10-
import { CommonModal, CommonModalProps } from './common-modal'
10+
import type { CommonModalProps } from './common-modal'
11+
import { CommonModal } from './common-modal'
1112

1213
export interface DeletionModalProps extends CommonModalProps {
1314
onConfirm: () => void

src/components/common/modals/error-modal.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66

77
import React from 'react'
88
import { Modal } from 'react-bootstrap'
9-
import { CommonModal, CommonModalProps } from './common-modal'
9+
import type { CommonModalProps } from './common-modal'
10+
import { CommonModal } from './common-modal'
1011

1112
export const ErrorModal: React.FC<CommonModalProps> = ({ show, onHide, titleI18nKey, icon, children }) => {
1213
return (

src/components/common/note-frontmatter/extract-frontmatter.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66

77
import { extractFrontmatter } from './extract-frontmatter'
8-
import { PresentFrontmatterExtractionResult } from './types'
8+
import type { PresentFrontmatterExtractionResult } from './types'
99

1010
describe('frontmatter extraction', () => {
1111
describe('isPresent property', () => {

src/components/common/note-frontmatter/extract-frontmatter.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* SPDX-License-Identifier: AGPL-3.0-only
55
*/
6-
import { FrontmatterExtractionResult } from './types'
6+
import type { FrontmatterExtractionResult } from './types'
77

88
const FRONTMATTER_BEGIN_REGEX = /^-{3,}$/
99
const FRONTMATTER_END_REGEX = /^(?:-{3,}|\.{3,})$/

src/components/common/note-frontmatter/note-frontmatter.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66

77
// import { RevealOptions } from 'reveal.js'
88
import { load } from 'js-yaml'
9-
import { ISO6391, NoteTextDirection, NoteType, RawNoteFrontmatter, SlideOptions } from './types'
9+
import type { RawNoteFrontmatter, SlideOptions } from './types'
10+
import { ISO6391, NoteTextDirection, NoteType } from './types'
1011
import { initialSlideOptions } from '../../../redux/note-details/initial-state'
1112

1213
/**

src/components/common/note-frontmatter/types.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* SPDX-License-Identifier: AGPL-3.0-only
55
*/
66

7-
import { RevealOptions } from 'reveal.js'
7+
import type { RevealOptions } from 'reveal.js'
88

99
export type FrontmatterExtractionResult = PresentFrontmatterExtractionResult | NonPresentFrontmatterExtractionResult
1010

src/components/common/routing/note-direct-link-redirector.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { Redirect } from 'react-router'
99
import { useParams } from 'react-router-dom'
1010
import { getNote } from '../../../api/notes'
1111
import { NotFoundErrorScreen } from './not-found-error-screen'
12-
import { NoteDto } from '../../../api/notes/types'
12+
import type { NoteDto } from '../../../api/notes/types'
1313

1414
interface RouteParameters {
1515
id: string

src/components/document-read-only-page/ErrorWhileLoadingNoteAlert.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import React from 'react'
88
import { Alert } from 'react-bootstrap'
99
import { Trans, useTranslation } from 'react-i18next'
1010
import { ShowIf } from '../common/show-if/show-if'
11-
import { SimpleAlertProps } from '../common/simple-alert/simple-alert-props'
11+
import type { SimpleAlertProps } from '../common/simple-alert/simple-alert-props'
1212

1313
export const ErrorWhileLoadingNoteAlert: React.FC<SimpleAlertProps> = ({ show }) => {
1414
useTranslation()

src/components/document-read-only-page/LoadingNoteAlert.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import React from 'react'
88
import { Alert } from 'react-bootstrap'
99
import { Trans } from 'react-i18next'
1010
import { ShowIf } from '../common/show-if/show-if'
11-
import { SimpleAlertProps } from '../common/simple-alert/simple-alert-props'
11+
import type { SimpleAlertProps } from '../common/simple-alert/simple-alert-props'
1212

1313
export const LoadingNoteAlert: React.FC<SimpleAlertProps> = ({ show }) => {
1414
return (

src/components/document-read-only-page/document-infobar.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* SPDX-License-Identifier: AGPL-3.0-only
55
*/
66

7-
import { DateTime } from 'luxon'
7+
import type { DateTime } from 'luxon'
88
import React from 'react'
99
import { Trans, useTranslation } from 'react-i18next'
1010
import { InternalLink } from '../common/links/internal-link'

src/components/editor-page/app-bar/read-only-mode-button.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { ForkAwesomeIcon } from '../../common/fork-awesome/fork-awesome-icon'
1010
import { Link } from 'react-router-dom'
1111
import { useTranslation } from 'react-i18next'
1212
import { useParams } from 'react-router'
13-
import { EditorPagePathParams } from '../editor-page'
13+
import type { EditorPagePathParams } from '../editor-page'
1414

1515
export const ReadOnlyModeButton: React.FC = () => {
1616
const { t } = useTranslation()

0 commit comments

Comments
 (0)