fix: address ObsidianReviewBot linting issues
- Add type guard for recursive parameter in notifications.ts to ensure only boolean values are stringified (prevents [object Object] output) - Remove unused error variables from catch blocks across 5 files: - vault-tools.ts (5 instances) - frontmatter-utils.ts (3 instances) - search-utils.ts (2 instances) - waypoint-utils.ts (1 instance)
This commit is contained in:
@@ -286,7 +286,7 @@ export class VaultTools {
|
|||||||
try {
|
try {
|
||||||
const content = await this.vault.read(item);
|
const content = await this.vault.read(item);
|
||||||
fileMetadata.wordCount = ContentUtils.countWords(content);
|
fileMetadata.wordCount = ContentUtils.countWords(content);
|
||||||
} catch (error) {
|
} catch {
|
||||||
// Skip word count if file can't be read (binary file, etc.)
|
// Skip word count if file can't be read (binary file, etc.)
|
||||||
// wordCount field simply omitted for this file
|
// wordCount field simply omitted for this file
|
||||||
}
|
}
|
||||||
@@ -356,7 +356,7 @@ export class VaultTools {
|
|||||||
frontmatterSummary: summary
|
frontmatterSummary: summary
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch {
|
||||||
// If frontmatter extraction fails, just return base metadata
|
// If frontmatter extraction fails, just return base metadata
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -390,7 +390,7 @@ export class VaultTools {
|
|||||||
if (folderWithStat.stat && typeof folderWithStat.stat.mtime === 'number') {
|
if (folderWithStat.stat && typeof folderWithStat.stat.mtime === 'number') {
|
||||||
modified = folderWithStat.stat.mtime;
|
modified = folderWithStat.stat.mtime;
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch {
|
||||||
// Silently fail - modified will remain 0
|
// Silently fail - modified will remain 0
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -442,7 +442,7 @@ export class VaultTools {
|
|||||||
try {
|
try {
|
||||||
const content = await this.vault.read(item);
|
const content = await this.vault.read(item);
|
||||||
metadata.wordCount = ContentUtils.countWords(content);
|
metadata.wordCount = ContentUtils.countWords(content);
|
||||||
} catch (error) {
|
} catch {
|
||||||
// Skip word count if file can't be read (binary file, etc.)
|
// Skip word count if file can't be read (binary file, etc.)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -712,7 +712,7 @@ export class VaultTools {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch {
|
||||||
// Skip files that can't be read
|
// Skip files that can't be read
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -162,8 +162,8 @@ export class NotificationManager {
|
|||||||
if (args.folder && typeof args.folder === 'string') {
|
if (args.folder && typeof args.folder === 'string') {
|
||||||
keyParams.push(`folder: "${this.truncateString(args.folder, 30)}"`);
|
keyParams.push(`folder: "${this.truncateString(args.folder, 30)}"`);
|
||||||
}
|
}
|
||||||
if (args.recursive !== undefined) {
|
if (typeof args.recursive === 'boolean') {
|
||||||
keyParams.push(`recursive: ${String(args.recursive)}`);
|
keyParams.push(`recursive: ${args.recursive}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// If no key params, show first 50 chars of JSON
|
// If no key params, show first 50 chars of JSON
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ export class FrontmatterUtils {
|
|||||||
let parsedFrontmatter: Record<string, YAMLValue> | null = null;
|
let parsedFrontmatter: Record<string, YAMLValue> | null = null;
|
||||||
try {
|
try {
|
||||||
parsedFrontmatter = parseYaml(frontmatter) || {};
|
parsedFrontmatter = parseYaml(frontmatter) || {};
|
||||||
} catch (error) {
|
} catch {
|
||||||
// If parsing fails, return null for parsed frontmatter
|
// If parsing fails, return null for parsed frontmatter
|
||||||
parsedFrontmatter = null;
|
parsedFrontmatter = null;
|
||||||
}
|
}
|
||||||
@@ -326,7 +326,7 @@ export class FrontmatterUtils {
|
|||||||
compressed: true // Indicate data is compressed
|
compressed: true // Indicate data is compressed
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
} catch (decompressError) {
|
} catch {
|
||||||
// Decompression failed
|
// Decompression failed
|
||||||
return {
|
return {
|
||||||
isExcalidraw: true,
|
isExcalidraw: true,
|
||||||
@@ -355,9 +355,9 @@ export class FrontmatterUtils {
|
|||||||
version: jsonData.version || 2
|
version: jsonData.version || 2
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
} catch (error) {
|
} catch {
|
||||||
// If parsing fails, return with default values
|
// If parsing fails, return with default values
|
||||||
const isExcalidraw = content.includes('excalidraw-plugin') ||
|
const isExcalidraw = content.includes('excalidraw-plugin') ||
|
||||||
content.includes('"type":"excalidraw"');
|
content.includes('"type":"excalidraw"');
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -114,7 +114,7 @@ export class SearchUtils {
|
|||||||
filesWithMatches.add(file.path);
|
filesWithMatches.add(file.path);
|
||||||
matches.push(...filenameMatches);
|
matches.push(...filenameMatches);
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch {
|
||||||
// Skip files that can't be read
|
// Skip files that can't be read
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -323,7 +323,7 @@ export class SearchUtils {
|
|||||||
waypointContent.push(line);
|
waypointContent.push(line);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch {
|
||||||
// Skip files that can't be searched
|
// Skip files that can't be searched
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ export class WaypointUtils {
|
|||||||
try {
|
try {
|
||||||
const content = await vault.read(file);
|
const content = await vault.read(file);
|
||||||
hasWaypoint = this.hasWaypointMarker(content);
|
hasWaypoint = this.hasWaypointMarker(content);
|
||||||
} catch (error) {
|
} catch {
|
||||||
// If we can't read the file, we can't check for waypoints
|
// If we can't read the file, we can't check for waypoints
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user