From 3ae738b61a768b519ae0b7cc8f7973a1b955c26f Mon Sep 17 00:00:00 2001 From: Raoul Jacobs Date: Mon, 17 Nov 2025 08:43:50 +0100 Subject: [PATCH] refactor: Standardize task export command and setting names to lowercase --- main.js | 9 ++++----- src/main.ts | 8 ++++---- src/settings.ts | 8 ++------ 3 files changed, 10 insertions(+), 15 deletions(-) diff --git a/main.js b/main.js index 89ce8b1..6f611fb 100644 --- a/main.js +++ b/main.js @@ -53,7 +53,6 @@ var TaskExportSettingTab = class extends import_obsidian.PluginSettingTab { display() { const { containerEl } = this; containerEl.empty(); - new import_obsidian.Setting(containerEl).setName("Task Export Tool Settings").setHeading(); new import_obsidian.Setting(containerEl).setName("Output path").setDesc("CSV file location (relative to vault root)").addText((text) => text.setPlaceholder("outstanding_tasks.csv").setValue(this.plugin.settings.outputPath).onChange((value) => { this.plugin.settings.outputPath = value || "outstanding_tasks.csv"; void this.plugin.saveSettings(); @@ -449,19 +448,19 @@ var TaskExportPlugin = class extends import_obsidian3.Plugin { this.settings.debounceDelay, this.settings.customersFolder ); - this.addRibbonIcon("file-text", "Export Outstanding Tasks", async () => { + this.addRibbonIcon("file-text", "Export outstanding tasks", async () => { await this.exportTasks(); }); this.addCommand({ id: "export-tasks", - name: "Export Outstanding Tasks", + name: "Export outstanding tasks", callback: async () => { await this.exportTasks(); } }); this.addCommand({ id: "toggle-auto-export", - name: "Toggle Auto-Export", + name: "Toggle auto-export", callback: async () => { this.settings.autoExport = !this.settings.autoExport; await this.saveSettings(); @@ -472,7 +471,7 @@ var TaskExportPlugin = class extends import_obsidian3.Plugin { }); this.addCommand({ id: "open-settings", - name: "Open Export Settings", + name: "Open export settings", callback: () => { this.app.setting.open(); this.app.setting.openTabById(this.manifest.id); diff --git a/src/main.ts b/src/main.ts index 34dd6e3..6d38b43 100644 --- a/src/main.ts +++ b/src/main.ts @@ -29,14 +29,14 @@ export default class TaskExportPlugin extends Plugin { ); // Add ribbon icon - this.addRibbonIcon('file-text', 'Export Outstanding Tasks', async () => { + this.addRibbonIcon('file-text', 'Export outstanding tasks', async () => { await this.exportTasks(); }); // Add command: Export Outstanding Tasks this.addCommand({ id: 'export-tasks', - name: 'Export Outstanding Tasks', + name: 'Export outstanding tasks', callback: async () => { await this.exportTasks(); } @@ -45,7 +45,7 @@ export default class TaskExportPlugin extends Plugin { // Add command: Toggle Auto-Export this.addCommand({ id: 'toggle-auto-export', - name: 'Toggle Auto-Export', + name: 'Toggle auto-export', callback: async () => { this.settings.autoExport = !this.settings.autoExport; await this.saveSettings(); @@ -59,7 +59,7 @@ export default class TaskExportPlugin extends Plugin { // Add command: Open Export Settings this.addCommand({ id: 'open-settings', - name: 'Open Export Settings', + name: 'Open export settings', callback: () => { // @ts-ignore - accessing private API this.app.setting.open(); diff --git a/src/settings.ts b/src/settings.ts index 1129cfe..60aa036 100644 --- a/src/settings.ts +++ b/src/settings.ts @@ -1,4 +1,4 @@ -import { PluginSettingTab, Setting } from 'obsidian'; +import { App, PluginSettingTab, Setting } from 'obsidian'; import TaskExportPlugin from './main'; /** @@ -7,7 +7,7 @@ import TaskExportPlugin from './main'; export class TaskExportSettingTab extends PluginSettingTab { plugin: TaskExportPlugin; - constructor(app: any, plugin: TaskExportPlugin) { + constructor(app: App, plugin: TaskExportPlugin) { super(app, plugin); this.plugin = plugin; } @@ -17,10 +17,6 @@ export class TaskExportSettingTab extends PluginSettingTab { containerEl.empty(); - new Setting(containerEl) - .setName('Task Export Tool Settings') - .setHeading(); - // Output Path new Setting(containerEl) .setName('Output path')