mirror of
https://github.com/jacobtread/obsidian-timekeep.git
synced 2026-07-22 05:12:14 +00:00
chore: run linter and formatter
This commit is contained in:
parent
194946b5c3
commit
1376f09368
7 changed files with 32 additions and 32 deletions
|
|
@ -8,4 +8,4 @@
|
|||
"authorUrl": "https://jacobtread.com",
|
||||
"fundingUrl": "https://www.buymeacoffee.com/jacobtread",
|
||||
"isDesktopOnly": false
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,2 +1,2 @@
|
|||
patchedDependencies:
|
||||
pdfmake: patches/pdfmake.patch
|
||||
pdfmake: patches/pdfmake.patch
|
||||
|
|
|
|||
|
|
@ -624,46 +624,46 @@ export function setObsidianMockElementHelpers(node: Node) {
|
|||
|
||||
classes
|
||||
.flat(Infinity)
|
||||
.filter((c): c is string => typeof c === 'string')
|
||||
.flatMap(c => c.split(' '))
|
||||
.filter((c): c is string => typeof c === "string")
|
||||
.flatMap((c) => c.split(" "))
|
||||
.filter(Boolean)
|
||||
.forEach(c => classList.add(c));
|
||||
.forEach((c) => classList.add(c));
|
||||
});
|
||||
|
||||
(node as Element).addClasses = vi.fn().mockImplementation((classes: string[]) => {
|
||||
(node as Element).addClass(...classes);
|
||||
(node as Element).addClass(...classes);
|
||||
});
|
||||
|
||||
(node as Element).removeClass = vi.fn().mockImplementation((...classes: any[]) => {
|
||||
const classList = (node as Element).classList;
|
||||
const classList = (node as Element).classList;
|
||||
|
||||
classes
|
||||
.flat(Infinity)
|
||||
.filter((c): c is string => typeof c === 'string')
|
||||
.flatMap(c => c.split(' '))
|
||||
.filter(Boolean)
|
||||
.forEach(c => classList.remove(c));
|
||||
classes
|
||||
.flat(Infinity)
|
||||
.filter((c): c is string => typeof c === "string")
|
||||
.flatMap((c) => c.split(" "))
|
||||
.filter(Boolean)
|
||||
.forEach((c) => classList.remove(c));
|
||||
});
|
||||
|
||||
(node as Element).removeClasses = vi.fn().mockImplementation((classes: string[]) => {
|
||||
(node as Element).removeClass(...classes);
|
||||
(node as Element).removeClass(...classes);
|
||||
});
|
||||
|
||||
(node as Element).toggleClass = vi.fn().mockImplementation(
|
||||
(classes: string | string[], value: boolean) => {
|
||||
const classList = (node as Element).classList;
|
||||
(node as Element).toggleClass = vi
|
||||
.fn()
|
||||
.mockImplementation((classes: string | string[], value: boolean) => {
|
||||
const classList = (node as Element).classList;
|
||||
|
||||
const normalized = [classes]
|
||||
.flat(Infinity)
|
||||
.filter((c): c is string => typeof c === 'string')
|
||||
.flatMap(c => c.split(' '))
|
||||
.filter(Boolean);
|
||||
const normalized = [classes]
|
||||
.flat(Infinity)
|
||||
.filter((c): c is string => typeof c === "string")
|
||||
.flatMap((c) => c.split(" "))
|
||||
.filter(Boolean);
|
||||
|
||||
normalized.forEach(c => {
|
||||
classList.toggle(c, value);
|
||||
});
|
||||
}
|
||||
);
|
||||
normalized.forEach((c) => {
|
||||
classList.toggle(c, value);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -48,6 +48,6 @@ vi.mock("obsidian", () => {
|
|||
Platform: MockPlatform,
|
||||
FileView: MockFileView,
|
||||
EditableFileView: MockEditableFileView,
|
||||
requireApiVersion: mockRequireApiVersion
|
||||
requireApiVersion: mockRequireApiVersion,
|
||||
};
|
||||
});
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ export class TimesheetExportActions extends DomComponent {
|
|||
onload(): void {
|
||||
super.onload();
|
||||
|
||||
const actionsEl = this.containerEl.createDiv( {
|
||||
const actionsEl = this.containerEl.createDiv({
|
||||
cls: "timekeep-actions",
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -46,11 +46,11 @@ export class TimekeepLocatorModal extends SuggestModal<TimekeepRunningEntry> {
|
|||
}
|
||||
|
||||
renderSuggestion(value: TimekeepRunningEntry, el: HTMLElement) {
|
||||
el.createDiv( { text: value.running.name });
|
||||
el.createDiv({ text: value.running.name });
|
||||
el.createEl("small", { text: value.ref.file.path });
|
||||
}
|
||||
|
||||
onChooseSuggestion(item: TimekeepRunningEntry, _evt: MouseEvent | KeyboardEvent) {
|
||||
onChooseSuggestion(item: TimekeepRunningEntry, _evt: MouseEvent | KeyboardEvent) {
|
||||
void TimekeepRegistry.openItemRef(this.app.workspace, item.ref);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,4 +43,4 @@
|
|||
"2.1.1": "1.5.12",
|
||||
"2.1.2": "1.5.12",
|
||||
"2.1.3": "1.5.12"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue