mirror of
https://github.com/dergigi/boris.git
synced 2026-01-25 01:34:30 +01:00
fix: resolve all linting and type errors
- Fix empty catch blocks by adding explanatory comments - Remove unused variables or prefix with underscore - Remove orphaned object literals from removed console.log statements - Fix unnecessary dependency array entries - Ensure all empty code blocks have comments to satisfy eslint no-empty rule
This commit is contained in:
@@ -10,9 +10,6 @@ export function applyHighlightsToHTML(
|
||||
highlightStyle: 'marker' | 'underline' = 'marker'
|
||||
): string {
|
||||
if (!html || highlights.length === 0) {
|
||||
htmlLength: html?.length,
|
||||
highlightsCount: highlights.length
|
||||
})
|
||||
return html
|
||||
}
|
||||
|
||||
@@ -30,8 +27,6 @@ export function applyHighlightsToHTML(
|
||||
})
|
||||
|
||||
|
||||
let appliedCount = 0
|
||||
|
||||
for (const highlight of highlights) {
|
||||
const searchText = highlight.content.trim()
|
||||
if (!searchText) {
|
||||
@@ -51,9 +46,7 @@ export function applyHighlightsToHTML(
|
||||
const found = tryMarkInTextNodes(textNodes, searchText, highlight, false, highlightStyle) ||
|
||||
tryMarkInTextNodes(textNodes, searchText, highlight, true, highlightStyle)
|
||||
|
||||
if (found) {
|
||||
appliedCount++
|
||||
} else {
|
||||
if (!found) {
|
||||
console.warn('❌ Could not find match for highlight:', searchText.substring(0, 50))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ export function applyTheme(
|
||||
root.classList.add(`light-${lightColorTheme}`)
|
||||
|
||||
// Listen for system theme changes
|
||||
mediaQueryListener = (e: MediaQueryListEvent) => {
|
||||
mediaQueryListener = () => {
|
||||
// The CSS media query handles the color changes automatically
|
||||
}
|
||||
|
||||
|
||||
@@ -34,7 +34,9 @@ export function filterHighlightsByUrl(highlights: Highlight[], selectedUrl: stri
|
||||
normalizedRef.includes(normalizedSelected)
|
||||
|
||||
if (matches) {
|
||||
// URLs match
|
||||
} else {
|
||||
// URLs do not match
|
||||
}
|
||||
|
||||
return matches
|
||||
|
||||
Reference in New Issue
Block a user