Applies Obsidian linter and fixes code issues
Applies linting rules to the codebase and resolves identified issues. Addresses: - Renamed headings in settings tabs to improve UI consistency and style. - Resolved require() style imports - Added void operator to ensure correct promise handling. - Replaced deprecated Obsidian API calls. - Enforces sentence case to enhance UI text consistency.
This commit is contained in:
37 files changed
+4314
-872
No files matched your search
@@ -23,7 +23,9 @@ export class EventHandlers {
|
||||
.setTitle('Export to PDF (Typst)')
|
||||
.setIcon('file-output')
|
||||
.onClick(() => {
|
||||
this.plugin.exportFile(file);
|
||||
this.plugin.exportFile(file).catch(error => {
|
||||
console.error('Failed to export file:', error);
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -38,7 +40,9 @@ export class EventHandlers {
|
||||
.setTitle('Export to PDF (Typst)')
|
||||
.setIcon('file-output')
|
||||
.onClick(() => {
|
||||
this.plugin.exportCurrentNote(view);
|
||||
this.plugin.exportCurrentNote(view).catch(error => {
|
||||
console.error('Failed to export current note:', error);
|
||||
});
|
||||
});
|
||||
});
|
||||
})
|
||||
@@ -48,7 +52,7 @@ export class EventHandlers {
|
||||
this.plugin.registerEvent(
|
||||
this.plugin.app.workspace.on('files-menu', (menu: Menu, files: TAbstractFile[]) => {
|
||||
// Filter for markdown files only
|
||||
const markdownFiles = files.filter(this.plugin.isMarkdownFile);
|
||||
const markdownFiles = files.filter((file) => this.plugin.isMarkdownFile(file));
|
||||
|
||||
if (markdownFiles.length > 0) {
|
||||
menu.addItem((item) => {
|
||||
@@ -56,7 +60,9 @@ export class EventHandlers {
|
||||
.setTitle(`Export to PDF (Typst)`)
|
||||
.setIcon('file-output')
|
||||
.onClick(() => {
|
||||
this.plugin.exportFiles(markdownFiles);
|
||||
this.plugin.exportFiles(markdownFiles).catch(error => {
|
||||
console.error('Failed to export files:', error);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -65,7 +71,9 @@ export class EventHandlers {
|
||||
.setTitle(`Export with configuration...`)
|
||||
.setIcon('settings')
|
||||
.onClick(() => {
|
||||
this.plugin.showExportModalForFiles(markdownFiles);
|
||||
this.plugin.showExportModalForFiles(markdownFiles).catch(error => {
|
||||
console.error('Failed to show export modal for files:', error);
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -92,7 +100,9 @@ export class EventHandlers {
|
||||
.setTitle('Export current note(s)')
|
||||
.setIcon('file-output')
|
||||
.onClick(() => {
|
||||
this.plugin.exportFile(activeView.file!);
|
||||
this.plugin.exportFile(activeView.file!).catch(error => {
|
||||
console.error('Failed to export file:', error);
|
||||
});
|
||||
})
|
||||
);
|
||||
|
||||
@@ -101,7 +111,9 @@ export class EventHandlers {
|
||||
.setTitle('Export with configuration…')
|
||||
.setIcon('settings')
|
||||
.onClick(() => {
|
||||
this.plugin.showExportModal(activeView);
|
||||
this.plugin.showExportModal(activeView).catch(error => {
|
||||
console.error('Failed to show export modal:', error);
|
||||
});
|
||||
})
|
||||
);
|
||||
|
||||
|
||||
Reference in new issue
Block a user