From 163df7be62bd6388115e9ebf0ef7a267862980c3 Mon Sep 17 00:00:00 2001 From: thyttan <6uuxstm66@mozmail.comā©> Date: Fri, 1 Nov 2024 01:43:12 +0100 Subject: [PATCH] spotrem: fix lint warnings no-undef --- apps/spotrem/ChangeLog | 8 +++----- apps/spotrem/app.js | 26 +++++++++++++------------- apps/spotrem/metadata.json | 2 +- 3 files changed, 17 insertions(+), 19 deletions(-) diff --git a/apps/spotrem/ChangeLog b/apps/spotrem/ChangeLog index 0f4cd3483..723fbd2d7 100644 --- a/apps/spotrem/ChangeLog +++ b/apps/spotrem/ChangeLog @@ -7,9 +7,7 @@ 0.07: Remove just the specific listeners to not interfere with Quick Launch when fastloading. 0.08: Issue newline before GB commands (solves issue with console.log and ignored commands) -0.09: Don't send the gadgetbridge wake command twice. Once should do since we - issue newline before GB commands. +0.09: Don't send the gadgetbridge wake command twice. Once should do since we issue newline before GB commands. 0.10: Some refactoring to shorten the code. -0.11: Further refactoring to shorten the code. Fixed search and play that was - broken in v0.10. - +0.11: Further refactoring to shorten the code. Fixed search and play that was broken in v0.10. +0.12: Fix some warnings from the linter. diff --git a/apps/spotrem/app.js b/apps/spotrem/app.js index bb3e9920d..4abc5392c 100644 --- a/apps/spotrem/app.js +++ b/apps/spotrem/app.js @@ -13,7 +13,7 @@ let dark = g.theme.dark; // bool let gfx = function() { widgetUtils.hide(); R = Bangle.appRect; - marigin = 8; + const MARIGIN = 8; // g.drawString(str, x, y, solid) g.clearRect(R); g.reset(); @@ -21,38 +21,38 @@ let gfx = function() { if (dark) {g.setColor(0x07E0);} else {g.setColor(0x03E0);} // Green on dark theme, DarkGreen on light theme. g.setFont("4x6:2"); g.setFontAlign(1, 0, 0); - g.drawString("->", R.x2 - marigin, R.y + R.h/2); + g.drawString("->", R.x2 - MARIGIN, R.y + R.h/2); g.setFontAlign(-1, 0, 0); - g.drawString("<-", R.x + marigin, R.y + R.h/2); + g.drawString("<-", R.x + MARIGIN, R.y + R.h/2); g.setFontAlign(-1, 0, 1); - g.drawString("<-", R.x + R.w/2, R.y + marigin); + g.drawString("<-", R.x + R.w/2, R.y + MARIGIN); g.setFontAlign(1, 0, 1); - g.drawString("->", R.x + R.w/2, R.y2 - marigin); + g.drawString("->", R.x + R.w/2, R.y2 - MARIGIN); g.setFontAlign(0, 0, 0); g.drawString("Play\nPause", R.x + R.w/2, R.y + R.h/2); g.setFontAlign(-1, -1, 0); - g.drawString("Menu", R.x + 2*marigin, R.y + 2*marigin); + g.drawString("Menu", R.x + 2*MARIGIN, R.y + 2*MARIGIN); g.setFontAlign(-1, 1, 0); - g.drawString("Wake", R.x + 2*marigin, R.y + R.h - 2*marigin); + g.drawString("Wake", R.x + 2*MARIGIN, R.y + R.h - 2*MARIGIN); g.setFontAlign(1, -1, 0); - g.drawString("Srch", R.x + R.w - 2*marigin, R.y + 2*marigin); + g.drawString("Srch", R.x + R.w - 2*MARIGIN, R.y + 2*MARIGIN); g.setFontAlign(1, 1, 0); - g.drawString("Saved", R.x + R.w - 2*marigin, R.y + R.h - 2*marigin); + g.drawString("Saved", R.x + R.w - 2*MARIGIN, R.y + R.h - 2*MARIGIN); }; // Touch handler for main layout let touchHandler = function(_, xy) { - x = xy.x; - y = xy.y; - len = (R.wb-1 instead of a>b. if ((R.x-1