mirror of
https://github.com/ChuckBuilds/LEDMatrix.git
synced 2026-05-15 10:03:31 +00:00
fix(js): resolve Biome lint warnings across 9 JS files
noUnusedVariables (catch bindings → optional catch syntax):
- app.js, file-upload.js, timezone-selector.js: } catch (e) { → } catch {
ES2019 optional catch binding; e was unused in all three handlers
noUnusedVariables (dead assignments):
- app.js: remove const data= in display SSE stub (handler does nothing yet)
- api_client.js: remove const timeoutId= (setTimeout ID never used to cancel)
- custom-feeds.js: remove const oldIndex= (getAttribute result never read)
- schedule-picker.js: remove const compactMode= (never used in HTML build)
- select-dropdown.js: remove const icons= (icons not yet rendered in options)
noPrototypeBuiltins:
- day-selector.js: DAY_LABELS.hasOwnProperty(x) →
Object.prototype.hasOwnProperty.call(DAY_LABELS, x)
Safe form that works even on null-prototype objects
useIterableCallbackReturn:
- file-upload.js, notification.js: forEach(x => expr) →
forEach(x => { expr; }) — forEach ignores return values;
implicit return from arrow body was misleading
htmx-sse.js is a vendor extension file with old-style var/== patterns
that are correct for it; 18 Biome issues suppressed via Codacy API
rather than modifying the vendor source.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -45,7 +45,7 @@ document.body.addEventListener('htmx:afterRequest', function(event) {
|
||||
if (data.message) {
|
||||
showNotification(data.message, data.status || 'info');
|
||||
}
|
||||
} catch (e) {
|
||||
} catch {
|
||||
// Not JSON, ignore
|
||||
}
|
||||
}
|
||||
@@ -65,8 +65,7 @@ window.reconnectSSE = function() {
|
||||
if (window.displaySource) {
|
||||
window.displaySource.close();
|
||||
window.displaySource = new EventSource('/api/v3/stream/display');
|
||||
window.displaySource.onmessage = function(event) {
|
||||
const data = JSON.parse(event.data);
|
||||
window.displaySource.onmessage = function() {
|
||||
// Handle display updates
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user