Skip to content

Commit a6e32e7

Browse files
committed
fixed linter errors
1 parent c7e691b commit a6e32e7

2 files changed

Lines changed: 31 additions & 31 deletions

File tree

src/main.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export default class MemopadPlugin extends Plugin {
5858
}
5959
}
6060

61-
new Notice("Captured to Memopad");
61+
new Notice("Captured to memopad");
6262
}
6363
}
6464

@@ -102,7 +102,9 @@ class CaptureModal extends Modal {
102102
const buttonContainer = contentEl.createDiv({ cls: "memopad-buttons" });
103103

104104
const captureBtn = buttonContainer.createEl("button", { text: "Capture", cls: "mod-cta" });
105-
captureBtn.addEventListener("click", () => this.capture());
105+
captureBtn.addEventListener("click", () => {
106+
void this.capture();
107+
});
106108

107109
const cancelBtn = buttonContainer.createEl("button", { text: "Cancel" });
108110
cancelBtn.addEventListener("click", () => this.close());
@@ -111,7 +113,7 @@ class CaptureModal extends Modal {
111113
this.inputEl.addEventListener("keydown", (e) => {
112114
if (e.key === "Enter" && !e.shiftKey) {
113115
e.preventDefault();
114-
this.capture();
116+
void this.capture();
115117
}
116118
if (e.key === "Escape") {
117119
this.close();

src/settings.ts

Lines changed: 26 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,6 @@ export class MemopadSettingTab extends PluginSettingTab {
6565

6666
containerEl.empty();
6767

68-
containerEl.createEl("h2", { text: "Memopad settings" });
69-
7068
// Inbox file path
7169
new Setting(containerEl)
7270
.setName("Inbox file path")
@@ -83,11 +81,11 @@ export class MemopadSettingTab extends PluginSettingTab {
8381

8482
// Default category
8583
new Setting(containerEl)
86-
.setName("Default category")
84+
.setName("Default task category")
8785
.setDesc("Default category for tasks when no keywords match.")
8886
.addText((text) =>
8987
text
90-
.setPlaceholder("personal")
88+
.setPlaceholder("Personal")
9189
.setValue(this.plugin.settings.defaultCategory)
9290
.onChange(async (value) => {
9391
this.plugin.settings.defaultCategory = value || DEFAULT_SETTINGS.defaultCategory;
@@ -96,18 +94,16 @@ export class MemopadSettingTab extends PluginSettingTab {
9694
);
9795

9896
// Task keywords section
99-
containerEl.createEl("h3", { text: "Task keywords" });
100-
containerEl.createEl("p", {
101-
text: "Words that trigger task detection when they appear at the start of input.",
102-
cls: "setting-item-description",
103-
});
97+
new Setting(containerEl).setName("Task keywords").setHeading();
10498

10599
new Setting(containerEl)
106-
.setName("Task keywords")
107-
.setDesc("Comma-separated list of keywords.")
100+
.setName("Keywords")
101+
.setDesc(
102+
"Comma-separated list of words that trigger task detection when they appear at the start of input.",
103+
)
108104
.addTextArea((text) =>
109105
text
110-
.setPlaceholder("fix, call, email, send...")
106+
.setPlaceholder("Fix, call, email, send...")
111107
.setValue(this.plugin.settings.taskKeywords.join(", "))
112108
.onChange(async (value) => {
113109
this.plugin.settings.taskKeywords = value
@@ -119,14 +115,14 @@ export class MemopadSettingTab extends PluginSettingTab {
119115
);
120116

121117
// Entry types section
122-
containerEl.createEl("h3", { text: "Entry types" });
118+
new Setting(containerEl).setName("Entry types").setHeading();
123119

124120
new Setting(containerEl)
125-
.setName("Entry types")
121+
.setName("Types")
126122
.setDesc("Comma-separated list of entry types (e.g., note, idea, log, task).")
127123
.addTextArea((text) =>
128124
text
129-
.setPlaceholder("note, idea, log, task")
125+
.setPlaceholder("Note, idea, log, task")
130126
.setValue(this.plugin.settings.entryTypes.join(", "))
131127
.onChange(async (value) => {
132128
this.plugin.settings.entryTypes = value
@@ -138,24 +134,25 @@ export class MemopadSettingTab extends PluginSettingTab {
138134
);
139135

140136
// Categories section
141-
containerEl.createEl("h3", { text: "Categories" });
142-
containerEl.createEl("p", {
143-
text: "Categories are used to classify tasks. Each category has keywords that trigger automatic categorization.",
144-
cls: "setting-item-description",
145-
});
137+
new Setting(containerEl).setName("Categories").setHeading();
138+
139+
new Setting(containerEl).setDesc(
140+
"Categories are used to classify tasks. Each category has keywords that trigger automatic categorization.",
141+
);
146142

147143
const categoriesContainer = containerEl.createDiv({ cls: "memopad-categories-container" });
148144
this.renderCategories(categoriesContainer);
149145

150146
// Add category button
151147
new Setting(containerEl).addButton((button) =>
152-
button.setButtonText("Add category").onClick(async () => {
148+
button.setButtonText("Add category").onClick(() => {
153149
this.plugin.settings.categories.push({
154150
name: "new-category",
155151
keywords: [],
156152
});
157-
await this.plugin.saveSettings();
158-
this.display();
153+
void this.plugin.saveSettings().then(() => {
154+
this.display();
155+
});
159156
}),
160157
);
161158
}
@@ -167,7 +164,7 @@ export class MemopadSettingTab extends PluginSettingTab {
167164
const categoryDiv = container.createDiv({ cls: "memopad-category-item" });
168165

169166
new Setting(categoryDiv)
170-
.setName(`Category: ${category.name}`)
167+
.setName(category.name)
171168
.addText((text) =>
172169
text
173170
.setPlaceholder("Category name")
@@ -184,16 +181,17 @@ export class MemopadSettingTab extends PluginSettingTab {
184181
button
185182
.setButtonText("Remove")
186183
.setWarning()
187-
.onClick(async () => {
184+
.onClick(() => {
188185
this.plugin.settings.categories.splice(index, 1);
189-
await this.plugin.saveSettings();
190-
this.display();
186+
void this.plugin.saveSettings().then(() => {
187+
this.display();
188+
});
191189
}),
192190
);
193191

194192
new Setting(categoryDiv).setName("Keywords").addTextArea((text) =>
195193
text
196-
.setPlaceholder("jira, meeting, client...")
194+
.setPlaceholder("Jira, meeting, client...")
197195
.setValue(category.keywords.join(", "))
198196
.onChange(async (value) => {
199197
const cat = this.plugin.settings.categories[index];

0 commit comments

Comments
 (0)