From 0077b1155bc45fde58c7ecc7a7611ebba98ab512 Mon Sep 17 00:00:00 2001 From: Kodai Nakamura Date: Thu, 11 Dec 2025 17:31:10 +0900 Subject: [PATCH] chore: Swap Obsidian Linter and Prettier execution order --- src/main.ts | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/main.ts b/src/main.ts index 7652cc0..7b1d52a 100644 --- a/src/main.ts +++ b/src/main.ts @@ -427,7 +427,13 @@ export default class AutomaticLinkerPlugin extends Plugin { await sleep(this.settings.formatDelayMs ?? 100); await this.formatOnSave(); - // Run Obsidian Linter after formatting if enabled + if (this.settings.runPrettierAfterFormatting) { + await sleep(this.settings.formatDelayMs ?? 100); + //@ts-expect-error + await this.app?.commands?.executeCommandById( + "prettier-format:format-file", + ); + } if (this.settings.runLinterAfterFormatting) { await sleep(this.settings.formatDelayMs ?? 100); //@ts-expect-error @@ -436,13 +442,6 @@ export default class AutomaticLinkerPlugin extends Plugin { ); } - if (this.settings.runPrettierAfterFormatting) { - await sleep(this.settings.formatDelayMs ?? 100); - //@ts-expect-error - await this.app?.commands?.executeCommandById( - "prettier-format:format-file", - ); - } } }; }