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
2 changed files with 5 additions and 4 deletions
Showing only changes of commit efbff4e172 - Show all commits

No files matched your search

1
@@ -115,7 +115,7 @@ export class FrontmatterProcessor {
// Return content without frontmatter, but add title as frontmatter for Pandoc
coderabbitai[bot] commented 2025-11-09 10:57:56 +01:00 (Migrated from github.com)
Review

⚠️ Potential issue | 🟡 Minor

Fix indentation inconsistencies.

These lines appear to have extra leading whitespace. Ensure consistent indentation throughout the file.

Apply this diff to fix line 118:

 			if (this.noteTitle) {
-					const titleFrontmatter = yaml.dump({ title: this.noteTitle });
+				const titleFrontmatter = yaml.dump({ title: this.noteTitle });
 				processedContent = `---\n${titleFrontmatter}---\n${parsed.content}`;

Apply similar fixes to lines 185 and 204:

 				if (this.noteTitle) {
-							const newFrontmatter = yaml.dump(frontmatter);
+					const newFrontmatter = yaml.dump(frontmatter);
 					let processedContent = content.replace(this.FRONTMATTER_PATTERN, `---\n${newFrontmatter}---\n`);
 				if (this.noteTitle) {
-							const titleFrontmatter = yaml.dump({ title: this.noteTitle });
+					const titleFrontmatter = yaml.dump({ title: this.noteTitle });
 					let processedContent = content.replace(this.FRONTMATTER_PATTERN, `---\n${titleFrontmatter}---\n`);

Also applies to: 185-185, 204-204

🤖 Prompt for AI Agents
In src/converters/preprocessors/FrontmatterProcessor.ts around lines 118, 185
and 204, several lines have extra leading whitespace causing inconsistent
indentation; remove the extra leading spaces on each of the affected lines so
they align with the surrounding block indentation (match the same indent level
as neighboring statements), keeping existing spacing within the line intact and
ensuring the file's indentation style remains consistent.

✅ Addressed in commit efbff4e

_⚠️ Potential issue_ | _🟡 Minor_ **Fix indentation inconsistencies.** These lines appear to have extra leading whitespace. Ensure consistent indentation throughout the file. Apply this diff to fix line 118: ```diff if (this.noteTitle) { - const titleFrontmatter = yaml.dump({ title: this.noteTitle }); + const titleFrontmatter = yaml.dump({ title: this.noteTitle }); processedContent = `---\n${titleFrontmatter}---\n${parsed.content}`; ``` Apply similar fixes to lines 185 and 204: ```diff if (this.noteTitle) { - const newFrontmatter = yaml.dump(frontmatter); + const newFrontmatter = yaml.dump(frontmatter); let processedContent = content.replace(this.FRONTMATTER_PATTERN, `---\n${newFrontmatter}---\n`); ``` ```diff if (this.noteTitle) { - const titleFrontmatter = yaml.dump({ title: this.noteTitle }); + const titleFrontmatter = yaml.dump({ title: this.noteTitle }); let processedContent = content.replace(this.FRONTMATTER_PATTERN, `---\n${titleFrontmatter}---\n`); ``` Also applies to: 185-185, 204-204 <details> <summary>🤖 Prompt for AI Agents</summary> ``` In src/converters/preprocessors/FrontmatterProcessor.ts around lines 118, 185 and 204, several lines have extra leading whitespace causing inconsistent indentation; remove the extra leading spaces on each of the affected lines so they align with the surrounding block indentation (match the same indent level as neighboring statements), keeping existing spacing within the line intact and ensuring the file's indentation style remains consistent. ``` </details> <!-- This is an auto-generated comment by CodeRabbit --> ✅ Addressed in commit efbff4e
let processedContent: string;
if (this.noteTitle) {
const titleFrontmatter = yaml.dump({ title: this.noteTitle });
const titleFrontmatter = yaml.dump({ title: this.noteTitle });
processedContent = `---\n${titleFrontmatter}---\n${parsed.content}`;
} else {
processedContent = parsed.content;
@@ -182,7 +182,7 @@ export class FrontmatterProcessor {
if (this.preserveFrontmatter) {
// Reconstruct frontmatter with modified title
if (this.noteTitle) {
const newFrontmatter = yaml.dump(frontmatter);
const newFrontmatter = yaml.dump(frontmatter);
let processedContent = content.replace(this.FRONTMATTER_PATTERN, `---\n${newFrontmatter}---\n`);
// Add printed frontmatter if requested
@@ -201,7 +201,7 @@ export class FrontmatterProcessor {
} else {
// Add title as frontmatter for Pandoc even when not preserving original
if (this.noteTitle) {
const titleFrontmatter = yaml.dump({ title: this.noteTitle });
const titleFrontmatter = yaml.dump({ title: this.noteTitle });
let processedContent = content.replace(this.FRONTMATTER_PATTERN, `---\n${titleFrontmatter}---\n`);
// Add printed frontmatter if requested
@@ -324,6 +324,7 @@ export class FrontmatterProcessor {
}
} else {
// Handle null, undefined, or any other unexpected types
console.debug('FrontmatterProcessor: Unexpected type in frontmatter display formatting', `key: ${key}, type: ${typeof value}`);
formattedValue = '';
}
+1 -1
View File
1
@@ -21,7 +21,7 @@ export class TypographySection implements ModalSection {
// Font size settings are created after font dropdowns to preserve logical ordering
this.createFontSettings(state).catch(error => {
console.error('Failed to create font settings:', error);
// Font settings will fall back to default fonts if this fails
// If font loading fails, getAvailableFonts will use hardcoded fallback fonts
});
}