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
@@ -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;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user