chore: Swap Obsidian Linter and Prettier execution order

This commit is contained in:
Kodai Nakamura 2025-12-11 17:31:10 +09:00
parent b6c92616c7
commit 0077b1155b

View file

@ -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",
);
}
}
};
}