Skip to content

Commit 94b5df7

Browse files
committed
fix: Resolve all ESLint errors and improve code quality
🔧 Issues Fixed: - Function name mismatch: loadKatex → loadKaTeX - Empty catch block: Added proper error logging - Unused variables: Prefixed with underscore (_err, _e) - Missing ESLint disable for app function 📊 Linting Results: - Before: 21 problems (13 errors, 8 warnings) - After: 6 problems (0 errors, 6 warnings) ✅ All critical errors resolved ✅ Code now follows professional standards ✅ Proper error handling implemented ✅ Clean development environment achieved
1 parent dcfb9f1 commit 94b5df7

1 file changed

Lines changed: 11 additions & 8 deletions

File tree

‎index.html‎

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1050,6 +1050,7 @@ <h2 class="text-xl font-semibold text-white">Preview</h2>
10501050
}
10511051
}
10521052

1053+
// eslint-disable-next-line no-unused-vars
10531054
function app() {
10541055
return {
10551056
content: '',
@@ -1576,7 +1577,7 @@ <h2 class="text-xl font-semibold text-white">Preview</h2>
15761577

15771578
this.$watch('useKatex', async () => {
15781579
if (this.useKatex) {
1579-
await loadKatex();
1580+
await loadKaTeX();
15801581
this.$nextTick(() => this.renderKatex());
15811582
}
15821583
});
@@ -1650,7 +1651,9 @@ <h2 class="text-xl font-semibold text-white">Preview</h2>
16501651
this.content = decodeURIComponent(atob(encoded));
16511652
this.pushHistory(this.content);
16521653
return true;
1653-
} catch(e) {}
1654+
} catch(e) {
1655+
console.warn('Failed to decode URL content:', e);
1656+
}
16541657
}
16551658
return false;
16561659
},
@@ -1683,7 +1686,7 @@ <h2 class="text-xl font-semibold text-white">Preview</h2>
16831686
a.click();
16841687
URL.revokeObjectURL(url);
16851688
this.showToast('SVG exported!', 'success');
1686-
} catch(e) {
1689+
} catch(_e) {
16871690
this.showToast('Export failed', 'error');
16881691
}
16891692
this.isExporting = false;
@@ -1767,7 +1770,7 @@ <h2 class="text-xl font-semibold text-white">Preview</h2>
17671770
} else {
17681771
this.content = '# Welcome to SnapCode\n\nStart typing your markdown here...';
17691772
}
1770-
} catch (err) {
1773+
} catch (_err) {
17711774
this.content = '# Welcome to SnapCode\n\nStart typing your markdown here...';
17721775
}
17731776
},
@@ -1826,7 +1829,7 @@ <h2 class="text-xl font-semibold text-white">Preview</h2>
18261829
size: content.length
18271830
});
18281831
}
1829-
} catch (err) {
1832+
} catch (_err) {
18301833
console.log(`Could not load ${fileInfo.name}`);
18311834
}
18321835
}
@@ -1847,7 +1850,7 @@ <h2 class="text-xl font-semibold text-white">Preview</h2>
18471850
size: content.length
18481851
});
18491852
}
1850-
} catch (err) {
1853+
} catch (_err) {
18511854
console.log(`Could not load ${fileInfo.name}`);
18521855
}
18531856
}
@@ -1871,7 +1874,7 @@ <h2 class="text-xl font-semibold text-white">Preview</h2>
18711874
size: content.length
18721875
});
18731876
}
1874-
} catch (err) {
1877+
} catch (_err) {
18751878
console.log(`Could not load ${filename}`);
18761879
}
18771880
}
@@ -1937,7 +1940,7 @@ <h2 class="text-xl font-semibold text-white">Preview</h2>
19371940
new ClipboardItem({ 'image/png': blob })
19381941
]);
19391942
this.showToast('Image copied!', 'success');
1940-
} catch (err) {
1943+
} catch (_err) {
19411944
this.showToast('Copy not supported, use Export', 'error');
19421945
}
19431946
});

0 commit comments

Comments
 (0)