From 7153c06c63c735de81c76ac6eaca42481a2c3f0a Mon Sep 17 00:00:00 2001 From: Andras Schmelczer Date: Sat, 22 Mar 2025 18:10:50 +0000 Subject: [PATCH] Lint --- frontend/obsidian-plugin/src/views/logs-view.ts | 5 +++-- frontend/sync-client/src/services/sync-reset-error.ts | 2 +- frontend/sync-client/src/services/sync-service.ts | 10 +++++----- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/frontend/obsidian-plugin/src/views/logs-view.ts b/frontend/obsidian-plugin/src/views/logs-view.ts index 62a2bf22..a7ea6228 100644 --- a/frontend/obsidian-plugin/src/views/logs-view.ts +++ b/frontend/obsidian-plugin/src/views/logs-view.ts @@ -1,13 +1,14 @@ import type { WorkspaceLeaf } from "obsidian"; import { ItemView } from "obsidian"; -import { LogLevel, LogLine, type SyncClient } from "sync-client"; +import type { LogLine } from "sync-client"; +import { LogLevel, type SyncClient } from "sync-client"; export class LogsView extends ItemView { public static readonly TYPE = "logs-view"; public static readonly ICON = "logs"; private logsContainer: HTMLElement | undefined; - private logLineToElement: Map = new Map(); + private readonly logLineToElement = new Map(); public constructor( private readonly client: SyncClient, diff --git a/frontend/sync-client/src/services/sync-reset-error.ts b/frontend/sync-client/src/services/sync-reset-error.ts index d1aa2eb6..5e27dfb6 100644 --- a/frontend/sync-client/src/services/sync-reset-error.ts +++ b/frontend/sync-client/src/services/sync-reset-error.ts @@ -1,5 +1,5 @@ export class SyncResetError extends Error { - constructor() { + public constructor() { super("Sync was reset"); this.name = "SyncResetError"; } diff --git a/frontend/sync-client/src/services/sync-service.ts b/frontend/sync-client/src/services/sync-service.ts index 6684428f..0b3fcba3 100644 --- a/frontend/sync-client/src/services/sync-service.ts +++ b/frontend/sync-client/src/services/sync-service.ts @@ -70,7 +70,7 @@ export class SyncService { relativePath: RelativePath; contentBytes: Uint8Array; }): Promise { - const vaultName = this.settings.getSettings().vaultName; + const { vaultName } = this.settings.getSettings(); return this.withRetries(async () => { const formData = new FormData(); @@ -123,7 +123,7 @@ export class SyncService { relativePath: RelativePath; contentBytes: Uint8Array; }): Promise { - const vaultName = this.settings.getSettings().vaultName; + const { vaultName } = this.settings.getSettings(); return this.withRetries(async () => { this.logger.debug( @@ -175,7 +175,7 @@ export class SyncService { relativePath: RelativePath; }): Promise { return this.withRetries(async () => { - const vaultName = this.settings.getSettings().vaultName; + const { vaultName } = this.settings.getSettings(); const response = await this.client.DELETE( "/vaults/{vault_id}/documents/{document_id}", @@ -212,7 +212,7 @@ export class SyncService { }: { documentId: DocumentId; }): Promise { - const vaultName = this.settings.getSettings().vaultName; + const { vaultName } = this.settings.getSettings(); return this.withRetries(async () => { const response = await this.client.GET( @@ -248,7 +248,7 @@ export class SyncService { since?: VaultUpdateId ): Promise { return this.withRetries(async () => { - const vaultName = this.settings.getSettings().vaultName; + const { vaultName } = this.settings.getSettings(); const response = await this.client.GET( "/vaults/{vault_id}/documents",