refactor: clean up ESLint warnings and code quality
- Remove unused imports and variables across multiple files - Fix prefer-const warnings by changing let to const - Remove unused catch block variables or convert to parameter-less catch blocks - Update package-lock.json with TypeScript-ESLint v8 dependencies - Reduce ESLint warnings from 42 to 22 (remaining are necessary 'any' types) - All remaining warnings are for Obsidian API compatibility Fixes improve code quality while maintaining functionality. Remaining 'any' type warnings are appropriate for Obsidian plugin development. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
15 files changed
+349
-41
No files matched your search
@@ -62,7 +62,7 @@ export class WikilinkProcessor {
|
||||
private baseUrl?: string;
|
||||
|
||||
// Regex pattern for comprehensive wikilink matching with headings
|
||||
private readonly WIKILINK_WITH_HEADING_PATTERN = /\[\[([^#\|\]]+)(?:#([^|\]]+))?(?:\|([^\]]+))?\]\]/g;
|
||||
private readonly WIKILINK_WITH_HEADING_PATTERN = /\[\[([^#|\]]+)(?:#([^|\]]+))?(?:\|([^\]]+))?\]\]/g;
|
||||
|
||||
constructor(config: WikilinkProcessorConfig) {
|
||||
this.wikilinkConfig = config.wikilinkConfig;
|
||||
@@ -137,7 +137,7 @@ export class WikilinkProcessor {
|
||||
return filePath
|
||||
.replace(/[<>:"|?*]/g, '_') // Replace problematic characters
|
||||
.replace(/\s+/g, '%20') // URL encode spaces
|
||||
.replace(/[\\\/]/g, '/'); // Normalize path separators
|
||||
.replace(/[\\]/g, '/'); // Normalize path separators
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -147,7 +147,7 @@ export class WikilinkProcessor {
|
||||
return heading
|
||||
.toLowerCase()
|
||||
.replace(/\s+/g, '-') // Replace spaces with dashes
|
||||
.replace(/[^\w\-]/g, '') // Remove special characters except dashes
|
||||
.replace(/[^\w-]/g, '') // Remove special characters except dashes
|
||||
.replace(/--+/g, '-'); // Collapse multiple dashes
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user