diff --git a/backend/src/notes/notes.service.ts b/backend/src/notes/notes.service.ts index 111888589..43b1521a2 100644 --- a/backend/src/notes/notes.service.ts +++ b/backend/src/notes/notes.service.ts @@ -372,9 +372,9 @@ export class NotesService { return { id: note.publicId, aliases: await Promise.all( - ( - await note.aliases - ).map((alias) => this.aliasService.toAliasDto(alias, note)), + (await note.aliases).map((alias) => + this.aliasService.toAliasDto(alias, note), + ), ), primaryAddress: (await getPrimaryAlias(note)) ?? note.publicId, title: latestRevision.title, diff --git a/backend/src/realtime/realtime-note/realtime-connection.spec.ts b/backend/src/realtime/realtime-note/realtime-connection.spec.ts index d8a520bff..42a93aaec 100644 --- a/backend/src/realtime/realtime-note/realtime-connection.spec.ts +++ b/backend/src/realtime/realtime-note/realtime-connection.spec.ts @@ -32,7 +32,7 @@ jest.mock( ...jest.requireActual('@hedgedoc/commons'), // eslint-disable-next-line @typescript-eslint/naming-convention YDocSyncServerAdapter: jest.fn(() => Mock.of({})), - } as Record), + }) as Record, ); describe('websocket connection', () => { diff --git a/backend/src/revisions/revisions.service.ts b/backend/src/revisions/revisions.service.ts index 8e37d7541..bc038e114 100644 --- a/backend/src/revisions/revisions.service.ts +++ b/backend/src/revisions/revisions.service.ts @@ -143,9 +143,9 @@ export class RevisionsService { anonymousAuthorCount: revisionUserInfo.anonymousUserCount, patch: revision.patch, edits: await Promise.all( - ( - await revision.edits - ).map(async (edit) => await this.editService.toEditDto(edit)), + (await revision.edits).map( + async (edit) => await this.editService.toEditDto(edit), + ), ), }; } diff --git a/backend/src/sessions/session.service.ts b/backend/src/sessions/session.service.ts index 828c908bb..13697f972 100644 --- a/backend/src/sessions/session.service.ts +++ b/backend/src/sessions/session.service.ts @@ -61,8 +61,12 @@ export class SessionService { */ fetchUsernameForSessionId(sessionId: string): Promise { return new Promise((resolve, reject) => { - this.typeormStore.get(sessionId, (error?: Error, result?: SessionState) => - error || !result ? reject(error) : resolve(result.username as Username), + this.typeormStore.get( + sessionId, + (error?: Error, result?: SessionState) => + error || !result + ? reject(error) + : resolve(result.username as Username), ); }); } diff --git a/frontend/src/api/common/error-to-i18n-key-mapper.ts b/frontend/src/api/common/error-to-i18n-key-mapper.ts index d84fe86f0..b1200ecf7 100644 --- a/frontend/src/api/common/error-to-i18n-key-mapper.ts +++ b/frontend/src/api/common/error-to-i18n-key-mapper.ts @@ -11,7 +11,10 @@ import { ApiError } from './api-error' export class ErrorToI18nKeyMapper { private foundI18nKey: string | undefined = undefined - constructor(private apiError: Error, private i18nNamespace?: string) {} + constructor( + private apiError: Error, + private i18nNamespace?: string + ) {} public withHttpCode(code: number, i18nKey: string, treatAsAbsoluteKey?: boolean): this { if (this.foundI18nKey === undefined && this.apiError instanceof ApiError && this.apiError.statusCode === code) { diff --git a/frontend/src/components/editor-page/editor-pane/codemirror-extensions/document-sync/y-text-sync-view-plugin.ts b/frontend/src/components/editor-page/editor-pane/codemirror-extensions/document-sync/y-text-sync-view-plugin.ts index 0a40a081c..88befa94f 100644 --- a/frontend/src/components/editor-page/editor-pane/codemirror-extensions/document-sync/y-text-sync-view-plugin.ts +++ b/frontend/src/components/editor-page/editor-pane/codemirror-extensions/document-sync/y-text-sync-view-plugin.ts @@ -16,7 +16,11 @@ const syncAnnotation = Annotation.define() export class YTextSyncViewPlugin implements PluginValue { private readonly observer: YTextSyncViewPlugin['onYTextUpdate'] - constructor(private view: EditorView, private readonly yText: YText, pluginLoaded: () => void) { + constructor( + private view: EditorView, + private readonly yText: YText, + pluginLoaded: () => void + ) { this.observer = this.onYTextUpdate.bind(this) this.yText.observe(this.observer) pluginLoaded() diff --git a/frontend/src/components/editor-page/editor-pane/codemirror-extensions/remote-cursors/send-cursor-view-plugin.ts b/frontend/src/components/editor-page/editor-pane/codemirror-extensions/remote-cursors/send-cursor-view-plugin.ts index 0a84d8ca7..ac99289d1 100644 --- a/frontend/src/components/editor-page/editor-pane/codemirror-extensions/remote-cursors/send-cursor-view-plugin.ts +++ b/frontend/src/components/editor-page/editor-pane/codemirror-extensions/remote-cursors/send-cursor-view-plugin.ts @@ -16,7 +16,11 @@ export class SendCursorViewPlugin implements PluginValue { private lastCursor: SelectionRange | undefined private listener?: Listener - constructor(private view: EditorView, private messageTransporter: MessageTransporter, private mayEdit: boolean) { + constructor( + private view: EditorView, + private messageTransporter: MessageTransporter, + private mayEdit: boolean + ) { if (mayEdit) { this.listener = messageTransporter.doAsSoonAsReady(() => { this.sendCursor(this.lastCursor) diff --git a/frontend/src/components/editor-page/editor-pane/hooks/yjs/use-realtime-connection.ts b/frontend/src/components/editor-page/editor-pane/hooks/yjs/use-realtime-connection.ts index 829a8b0a7..2eef1df9c 100644 --- a/frontend/src/components/editor-page/editor-pane/hooks/yjs/use-realtime-connection.ts +++ b/frontend/src/components/editor-page/editor-pane/hooks/yjs/use-realtime-connection.ts @@ -40,10 +40,13 @@ export const useRealtimeConnection = (): MessageTransporter => { const socket = new WebSocket(websocketUrl.toString()) socket.addEventListener('error', () => { const timeout = WEBSOCKET_RECONNECT_INTERVAL + reconnectCount.current * 1000 + Math.random() * 1000 - setTimeout(() => { - reconnectCount.current += 1 - establishWebsocketConnection() - }, Math.max(timeout, WEBSOCKET_RECONNECT_MAX_DURATION)) + setTimeout( + () => { + reconnectCount.current += 1 + establishWebsocketConnection() + }, + Math.max(timeout, WEBSOCKET_RECONNECT_MAX_DURATION) + ) }) socket.addEventListener('open', () => { messageTransporter.setAdapter(new FrontendWebsocketAdapter(socket)) diff --git a/frontend/src/components/markdown-renderer/replace-components/code-block-component-replacer.ts b/frontend/src/components/markdown-renderer/replace-components/code-block-component-replacer.ts index cbe733cd9..2381cc38a 100644 --- a/frontend/src/components/markdown-renderer/replace-components/code-block-component-replacer.ts +++ b/frontend/src/components/markdown-renderer/replace-components/code-block-component-replacer.ts @@ -17,7 +17,10 @@ export interface CodeProps { * Checks if the given checked node is a code block with a specific language attribute and creates an react-element that receives the code. */ export class CodeBlockComponentReplacer extends ComponentReplacer { - constructor(private component: FunctionComponent, private language: string) { + constructor( + private component: FunctionComponent, + private language: string + ) { super() } diff --git a/frontend/src/components/markdown-renderer/replace-components/custom-tag-with-id-component-replacer.ts b/frontend/src/components/markdown-renderer/replace-components/custom-tag-with-id-component-replacer.ts index 0c9cb2463..82e30a963 100644 --- a/frontend/src/components/markdown-renderer/replace-components/custom-tag-with-id-component-replacer.ts +++ b/frontend/src/components/markdown-renderer/replace-components/custom-tag-with-id-component-replacer.ts @@ -17,7 +17,10 @@ export interface IdProps { * Replaces custom tags that have just an id () with react elements. */ export class CustomTagWithIdComponentReplacer extends ComponentReplacer { - constructor(private component: FunctionComponent, private tagName: string) { + constructor( + private component: FunctionComponent, + private tagName: string + ) { super() } diff --git a/frontend/src/components/render-page/window-post-message-communicator/window-post-message-communicator.ts b/frontend/src/components/render-page/window-post-message-communicator/window-post-message-communicator.ts index 3b830472a..70004abfa 100644 --- a/frontend/src/components/render-page/window-post-message-communicator/window-post-message-communicator.ts +++ b/frontend/src/components/render-page/window-post-message-communicator/window-post-message-communicator.ts @@ -39,7 +39,10 @@ export abstract class WindowPostMessageCommunicator< private readonly log: Logger private readonly boundListener: (event: MessageEvent) => void - public constructor(private readonly uuid: string, private readonly targetOrigin: string) { + public constructor( + private readonly uuid: string, + private readonly targetOrigin: string + ) { this.boundListener = this.handleEvent.bind(this) this.communicationEnabled = false this.log = this.createLogger() diff --git a/frontend/src/extensions/essential-app-extensions/blockquote/blockquote-extra-tag-markdown-it-plugin.ts b/frontend/src/extensions/essential-app-extensions/blockquote/blockquote-extra-tag-markdown-it-plugin.ts index 0fa66efd4..d4ef40d5d 100644 --- a/frontend/src/extensions/essential-app-extensions/blockquote/blockquote-extra-tag-markdown-it-plugin.ts +++ b/frontend/src/extensions/essential-app-extensions/blockquote/blockquote-extra-tag-markdown-it-plugin.ts @@ -26,7 +26,10 @@ export interface QuoteExtraTagValues { export class BlockquoteExtraTagMarkdownItPlugin { private static readonly BlockquoteExtraTagRuleName = 'blockquote_extra_tag' - constructor(private tagName: string, private icon: BootstrapIconName) {} + constructor( + private tagName: string, + private icon: BootstrapIconName + ) {} /** * Registers an inline rule that detects blockquote extra tags and replaces them with blockquote tokens. diff --git a/frontend/src/redux/note-details/reducers/build-state-from-first-heading-update.spec.ts b/frontend/src/redux/note-details/reducers/build-state-from-first-heading-update.spec.ts index 254d9bffa..ff770fd5b 100644 --- a/frontend/src/redux/note-details/reducers/build-state-from-first-heading-update.spec.ts +++ b/frontend/src/redux/note-details/reducers/build-state-from-first-heading-update.spec.ts @@ -13,7 +13,7 @@ jest.mock( ({ ...jest.requireActual('@hedgedoc/commons'), generateNoteTitle: () => 'generated title' - } as Record) + }) as Record ) describe('build state from first heading update', () => {