mirror of
https://github.com/shynkro/watchlog-obsidian-plugin.git
synced 2026-07-22 06:53:16 +00:00
Merge pull request #1 from Shynkro/public-release
fix: resolve all 22 review bot issues
This commit is contained in:
commit
d95983bb4d
7 changed files with 13 additions and 20 deletions
|
|
@ -295,8 +295,7 @@ export class AddTitleModal extends Modal {
|
|||
const relStack = relRow.createDiv({ cls: 'wl-modal-input-stack' });
|
||||
const relInput = relStack.createEl('input', {
|
||||
cls: 'wl-modal-input',
|
||||
// eslint-disable-next-line obsidianmd/ui/sentence-case
|
||||
attr: { type: 'text', placeholder: 'DD/MM/YYYY or YYYY-MM-DD' },
|
||||
attr: { type: 'text', placeholder: 'dd/mm/yyyy or yyyy-mm-dd' },
|
||||
});
|
||||
relInput.value = this.fieldReleaseDate;
|
||||
const relErrorEl = relStack.createDiv({ cls: 'wl-modal-error wl-hidden' });
|
||||
|
|
@ -314,8 +313,7 @@ export class AddTitleModal extends Modal {
|
|||
relErrorEl.addClass('wl-hidden');
|
||||
} else {
|
||||
this.fieldReleaseDate = raw;
|
||||
// eslint-disable-next-line obsidianmd/ui/sentence-case
|
||||
relErrorEl.textContent = 'Unrecognised format. Expected DD/MM/YYYY or YYYY-MM-DD.';
|
||||
relErrorEl.textContent = 'Unrecognised format. Expected dd/mm/yyyy or yyyy-mm-dd.';
|
||||
relErrorEl.removeClass('wl-hidden');
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -294,8 +294,7 @@ export class AirtimeTab {
|
|||
});
|
||||
|
||||
const deleteBtn = actions.createEl('button', { cls: 'wl-airtime-action-btn wl-airtime-action-btn-delete', text: '✕' });
|
||||
// eslint-disable-next-line obsidianmd/ui/sentence-case
|
||||
deleteBtn.title = 'Remove from Watchlist';
|
||||
deleteBtn.title = 'Remove from watchlist';
|
||||
deleteBtn.addEventListener('click', (e) => {
|
||||
e.stopPropagation();
|
||||
new ConfirmModal(this.plugin.app, `Remove "${title.title}" from Watchlist?`, () => {
|
||||
|
|
@ -381,8 +380,7 @@ export class AirtimeTab {
|
|||
else new Notice('No external link set.');
|
||||
});
|
||||
const deleteBtn = right.createEl('button', { cls: 'wl-airtime-action-btn wl-airtime-action-btn-delete', text: '✕' });
|
||||
// eslint-disable-next-line obsidianmd/ui/sentence-case
|
||||
deleteBtn.title = 'Remove from Maybe';
|
||||
deleteBtn.title = 'Remove from maybe';
|
||||
deleteBtn.addEventListener('click', (e) => {
|
||||
e.stopPropagation();
|
||||
new ConfirmModal(this.plugin.app, `Remove "${mt.title}" from Maybe?`, () => {
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ export class CustomListManager {
|
|||
}
|
||||
}
|
||||
|
||||
async listNames(): Promise<string[]> {
|
||||
listNames(): string[] {
|
||||
const dir = normalizePath(this.folderPath);
|
||||
return this.app.vault.getFiles()
|
||||
.filter(f => {
|
||||
|
|
|
|||
|
|
@ -177,8 +177,7 @@ export class EditTitleModal extends Modal {
|
|||
const relStack = relRow.createDiv({ cls: 'wl-modal-input-stack' });
|
||||
const relInput = relStack.createEl('input', {
|
||||
cls: 'wl-modal-input',
|
||||
// eslint-disable-next-line obsidianmd/ui/sentence-case
|
||||
attr: { type: 'text', placeholder: 'DD/MM/YYYY or YYYY-MM-DD' },
|
||||
attr: { type: 'text', placeholder: 'dd/mm/yyyy or yyyy-mm-dd' },
|
||||
});
|
||||
relInput.value = this.fieldReleaseDate;
|
||||
const relErrorEl = relStack.createDiv({ cls: 'wl-modal-error wl-hidden' });
|
||||
|
|
@ -196,8 +195,7 @@ export class EditTitleModal extends Modal {
|
|||
relErrorEl.addClass('wl-hidden');
|
||||
} else {
|
||||
this.fieldReleaseDate = raw;
|
||||
// eslint-disable-next-line obsidianmd/ui/sentence-case
|
||||
relErrorEl.textContent = 'Unrecognised format. Expected DD/MM/YYYY or YYYY-MM-DD.';
|
||||
relErrorEl.textContent = 'Unrecognised format. Expected dd/mm/yyyy or yyyy-mm-dd.';
|
||||
relErrorEl.removeClass('wl-hidden');
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -45,8 +45,7 @@ export class MaybeAddModal extends Modal {
|
|||
}
|
||||
|
||||
onOpen(): void {
|
||||
// eslint-disable-next-line obsidianmd/ui/sentence-case
|
||||
this.titleEl.setText('Add to Maybe');
|
||||
this.titleEl.setText('Add to maybe');
|
||||
this.contentEl.addClass('wl-add-modal');
|
||||
this.buildUI();
|
||||
}
|
||||
|
|
@ -188,8 +187,7 @@ export class MaybeAddModal extends Modal {
|
|||
|
||||
const relRow = makeRow('Release date');
|
||||
const relStack = relRow.createDiv({ cls: 'wl-modal-input-stack' });
|
||||
// eslint-disable-next-line obsidianmd/ui/sentence-case
|
||||
const relInput = relStack.createEl('input', { cls: 'wl-modal-input', attr: { type: 'text', placeholder: 'DD/MM/YYYY or YYYY-MM-DD' } });
|
||||
const relInput = relStack.createEl('input', { cls: 'wl-modal-input', attr: { type: 'text', placeholder: 'dd/mm/yyyy or yyyy-mm-dd' } });
|
||||
relInput.value = this.fieldReleaseDate;
|
||||
const relErrorEl = relStack.createDiv({ cls: 'wl-modal-error wl-hidden' });
|
||||
relInput.addEventListener('change', () => {
|
||||
|
|
@ -206,8 +204,7 @@ export class MaybeAddModal extends Modal {
|
|||
linkInput.addEventListener('input', () => { this.fieldLink = linkInput.value; });
|
||||
|
||||
const btnRow = this.formEl.createDiv({ cls: 'wl-modal-btn-row' });
|
||||
// eslint-disable-next-line obsidianmd/ui/sentence-case
|
||||
const addBtn = btnRow.createEl('button', { cls: 'wl-btn wl-btn-primary', text: 'Add to Maybe' });
|
||||
const addBtn = btnRow.createEl('button', { cls: 'wl-btn wl-btn-primary', text: 'Add to maybe' });
|
||||
addBtn.addEventListener('click', () => void this.addMaybeTitle());
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -48,11 +48,13 @@ export class WatchLogView extends ItemView {
|
|||
return 'tv';
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/require-await -- onOpen must be async to match ItemView base class signature
|
||||
async onOpen(): Promise<void> {
|
||||
this.dataManager.onChange(this.dataChangeListener);
|
||||
this.buildUI();
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/require-await -- onClose must be async to match ItemView base class signature
|
||||
async onClose(): Promise<void> {
|
||||
this.dataManager.offChange(this.dataChangeListener);
|
||||
this.destroyDraftsTab();
|
||||
|
|
|
|||
|
|
@ -377,7 +377,7 @@ export function parseReleaseDateInput(str: string): string | null {
|
|||
const trimmed = str.trim();
|
||||
if (!trimmed) return null;
|
||||
if (/^\d{4}-\d{2}-\d{2}$/.test(trimmed)) return trimmed;
|
||||
// eslint-disable-next-line no-useless-escape
|
||||
// eslint-disable-next-line no-useless-escape -- forward slash escaped for visual clarity in date regex
|
||||
const m = trimmed.match(/^(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{4})$/);
|
||||
if (m) {
|
||||
const dd = m[1]!.padStart(2, '0');
|
||||
|
|
|
|||
Loading…
Reference in a new issue