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:
AlexKucera committed 2025-11-05 13:46:06 +01:00
1 parent 3c3f86ae4f
commit 2c4076f3c9
37 files changed
+4314 -872

No files matched your search

+5 -2
View File
@@ -3,6 +3,7 @@
* Handles discovery of pdf2img and other CLI tools in the Obsidian environment.
*/
import { promises as fs } from 'fs';
import * as path from 'path';
import type { obsidianTypstPDFExport } from '../../../main';
import { PathUtils } from '../../core/PathUtils';
@@ -30,7 +31,10 @@ export class BinaryLocator {
// In Obsidian, __dirname points to electron.asar, so we need to find the actual plugin path
// Try multiple strategies to find the plugin directory
const pluginDirName = plugin?.manifest?.dir || 'typst-pdf-export';
const configDir = plugin?.app.vault.configDir || '.obsidian';
const configDir = plugin?.app.vault.configDir;
if (!configDir) {
throw new Error('Unable to determine Obsidian configuration directory');
}
const possiblePluginDirs = this.getPossiblePluginDirs(plugin, pluginDirName, configDir);
// Find the first directory that exists and has node_modules
@@ -154,7 +158,6 @@ export class BinaryLocator {
try {
if (!plugin?.app) {
// This should not happen in normal plugin operation, but provide fallback
const fs = require('fs').promises;
await fs.access(binaryPath);
return true;
}