From 5c8b02f69c37f014706c5c845e971cca2d092fc4 Mon Sep 17 00:00:00 2001 From: Andras Schmelczer Date: Sat, 24 May 2025 19:02:50 +0100 Subject: [PATCH] Lint --- .../obsidian-plugin/src/views/settings/settings-tab.ts | 10 ++++++---- .../sync-client/src/utils/globs-to-regexes.test.ts | 2 +- frontend/sync-client/src/utils/globs-to-regexes.ts | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/frontend/obsidian-plugin/src/views/settings/settings-tab.ts b/frontend/obsidian-plugin/src/views/settings/settings-tab.ts index c413203..34d1760 100644 --- a/frontend/obsidian-plugin/src/views/settings/settings-tab.ts +++ b/frontend/obsidian-plugin/src/views/settings/settings-tab.ts @@ -311,13 +311,15 @@ export class SyncSettingsTab extends PluginSettingTab { parsedValue = this.syncClient.getSettings().maxFileSizeMB; } - this.syncClient.setSetting( - "maxFileSizeMB", - parsedValue - ); + if (value !== parsedValue.toString()) { input.setValue(parsedValue.toString()); } + + return this.syncClient.setSetting( + "maxFileSizeMB", + parsedValue + ); }) ); diff --git a/frontend/sync-client/src/utils/globs-to-regexes.test.ts b/frontend/sync-client/src/utils/globs-to-regexes.test.ts index 753a828..71639a3 100644 --- a/frontend/sync-client/src/utils/globs-to-regexes.test.ts +++ b/frontend/sync-client/src/utils/globs-to-regexes.test.ts @@ -3,7 +3,7 @@ import { globsToRegexes } from "./globs-to-regexes"; describe("globsToRegexes", () => { it("basicExample", async () => { - const regex = globsToRegexes([".git/**"], new Logger())[0]; + const [regex] = globsToRegexes([".git/**"], new Logger()); expect(regex.test(".git/objects/object")).toBeTruthy(); expect(regex.test(".git/objects/.object")).toBeTruthy(); diff --git a/frontend/sync-client/src/utils/globs-to-regexes.ts b/frontend/sync-client/src/utils/globs-to-regexes.ts index fdeb445..1e8ad77 100644 --- a/frontend/sync-client/src/utils/globs-to-regexes.ts +++ b/frontend/sync-client/src/utils/globs-to-regexes.ts @@ -1,5 +1,5 @@ import { makeRe } from "minimatch"; -import { Logger } from "../tracing/logger"; +import type { Logger } from "../tracing/logger"; export function globsToRegexes(globs: string[], logger: Logger): RegExp[] { return globs