mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-23 19:47:03 -04:00
Update dependency eslint-plugin-import to v2.25.2 (#1555)
* Update dependency eslint-plugin-import to v2.25.2 Signed-off-by: Renovate Bot <bot@renovateapp.com> Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de> * Make type imports more explicit Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de> * Enforce use of type imports Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de> Co-authored-by: Renovate Bot <bot@renovateapp.com> Co-authored-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
parent
fc3a3fa1a9
commit
2abe40ef1d
264 changed files with 567 additions and 504 deletions
|
@ -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({
|
||||
|
|
|
@ -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: ''
|
||||
|
|
|
@ -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'
|
||||
|
|
|
@ -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({
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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'
|
||||
|
|
|
@ -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')
|
||||
|
|
|
@ -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() ??
|
||||
|
|
|
@ -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'
|
||||
|
|
|
@ -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')
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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',
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import { Action } from 'redux'
|
||||
import type { Action } from 'redux'
|
||||
|
||||
export enum HistoryEntryOrigin {
|
||||
LOCAL,
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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'
|
||||
|
||||
/**
|
||||
|
|
|
@ -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',
|
||||
|
|
|
@ -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',
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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'
|
||||
|
||||
|
|
|
@ -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',
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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'
|
||||
|
|
|
@ -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'
|
||||
|
||||
|
|
|
@ -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<UiNotificationState, UiNotificationActions> = (
|
||||
state: UiNotificationState = [],
|
||||
|
|
|
@ -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',
|
||||
|
|
|
@ -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 = {
|
||||
|
|
|
@ -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<OptionalUserState, UserActions> = (
|
||||
state: OptionalUserState = null,
|
||||
|
|
|
@ -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',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue