Update ESLint rules and resolve bot review feedback #8

Merged
AlexKucera merged 24 commits from obsidian-bot-review into master 2025-11-09 12:06:31 +01:00
Showing only changes of commit 5034e111eb - Show all commits
@@ -44,11 +44,10 @@ export class FrontmatterProcessor {
}
coderabbitai[bot] commented 2025-11-05 13:54:25 +01:00 (Migrated from github.com)
Review

⚠️ Potential issue | 🟠 Major

Remove raw-content logging from diagnostics.
These new console.debug/console.error statements dump the first 200–500 characters of user notes directly to the developer console. Even in debug builds this is sensitive content (frontmatter often includes titles, tags, authors, etc.), so shipping this logging materially increases the risk of leaking private vault data. Please strip the raw-content logging (or gate it behind an explicit opt-in) before release.

Also applies to: 152-154

🤖 Prompt for AI Agents
In src/converters/preprocessors/FrontmatterProcessor.ts around lines 49-51 (and
likewise remove similar logging at 152-154), remove the console.debug calls that
print the raw content snippet to avoid leaking sensitive user data; instead
either delete those debug statements entirely or replace them with non-sensitive
diagnostics (e.g., log only that frontmatter was detected and the content length
or a redacted/hashed preview), and if you need full-content logging keep it
strictly behind an explicit opt-in debug flag or environment variable checked
before printing.

✅ Addressed in commits f0daebc to c1c02ee

_⚠️ Potential issue_ | _🟠 Major_ **Remove raw-content logging from diagnostics.** These new `console.debug`/`console.error` statements dump the first 200–500 characters of user notes directly to the developer console. Even in debug builds this is sensitive content (frontmatter often includes titles, tags, authors, etc.), so shipping this logging materially increases the risk of leaking private vault data. Please strip the raw-content logging (or gate it behind an explicit opt-in) before release. Also applies to: 152-154 <details> <summary>🤖 Prompt for AI Agents</summary> ``` In src/converters/preprocessors/FrontmatterProcessor.ts around lines 49-51 (and likewise remove similar logging at 152-154), remove the console.debug calls that print the raw content snippet to avoid leaking sensitive user data; instead either delete those debug statements entirely or replace them with non-sensitive diagnostics (e.g., log only that frontmatter was detected and the content length or a redacted/hashed preview), and if you need full-content logging keep it strictly behind an explicit opt-in debug flag or environment variable checked before printing. ``` </details> <!-- fingerprinting:phantom:medusa:sabertoothed --> <!-- This is an auto-generated comment by CodeRabbit --> ✅ Addressed in commits f0daebc to c1c02ee
// Use gray-matter for robust frontmatter parsing
// Add debugging to see what's being parsed
console.debug('FrontmatterProcessor: Attempting to parse content with frontmatter pattern detected');
console.debug('First 200 chars:', content.substring(0, 200));
console.debug('FrontmatterProcessor: Attempting to parse content with frontmatter pattern detected', `(content length: ${content.length})`);
const parsed = matter(content);
if (parsed.data && Object.keys(parsed.data).length > 0) {
1
@@ -150,8 +149,7 @@ export class FrontmatterProcessor {
}
} catch (error: unknown) {
const errorMessage = error instanceof Error ? error.message : String(error);
console.error('FrontmatterProcessor: gray-matter failed with error:', errorMessage);
console.error('Content being parsed (first 500 chars):', content.substring(0, 500));
console.error('FrontmatterProcessor: gray-matter failed with error:', errorMessage, `(content length: ${content.length})`);
result.warnings.push(`Failed to parse frontmatter with gray-matter: ${errorMessage}`);
// Fallback to simple regex-based parsing