diff --git a/apps/.eslintrc.json b/apps/.eslintrc.json index d5a4bf2a3..a2973e931 100644 --- a/apps/.eslintrc.json +++ b/apps/.eslintrc.json @@ -144,7 +144,7 @@ ], "no-constant-condition": "off", "no-delete-var": "off", - "no-empty": "off", + "no-empty": ["warn", { "allowEmptyCatch": true }], "no-global-assign": "off", "no-inner-declarations": "off", "no-prototype-builtins": "off", diff --git a/apps/andark/app.js b/apps/andark/app.js index efa00ce6f..865e3e708 100644 --- a/apps/andark/app.js +++ b/apps/andark/app.js @@ -104,7 +104,6 @@ Bangle.on('lcdPower',on=>{ if (on) { secondInterval = setInterval(draw, 1000); draw(); // draw immediately - }else{ } }); Bangle.on('lock',on=>{ diff --git a/apps/aptsciclk/ChangeLog b/apps/aptsciclk/ChangeLog index ed32a45a2..19e7c9469 100644 --- a/apps/aptsciclk/ChangeLog +++ b/apps/aptsciclk/ChangeLog @@ -6,3 +6,4 @@ 0.06: Formatting 0.07: Added potato GLaDOS and quote functionality when you tap her 0.08: Fixed drawing issues with the quotes and added more +0.09: Minor code improvements diff --git a/apps/aptsciclk/app.js b/apps/aptsciclk/app.js index c2903cf37..f32a52870 100644 --- a/apps/aptsciclk/app.js +++ b/apps/aptsciclk/app.js @@ -270,8 +270,7 @@ function queueDraw() { function draw() { - if (pause){} - else{ + if (!pause){ // get date var d = new Date(); var da = d.toString().split(" "); diff --git a/apps/aptsciclk/metadata.json b/apps/aptsciclk/metadata.json index 77e40f843..edc9704d2 100644 --- a/apps/aptsciclk/metadata.json +++ b/apps/aptsciclk/metadata.json @@ -2,7 +2,7 @@ "id": "aptsciclk", "name": "Apeture Science Clock", "shortName":"AptSci Clock", - "version": "0.08", + "version": "0.09", "description": "A clock based on the portal series", "icon": "app.png", "screenshots": [{"url":"screenshot.png"}], diff --git a/apps/carcrazy/ChangeLog b/apps/carcrazy/ChangeLog index f697617b4..f4fd9ab7b 100644 --- a/apps/carcrazy/ChangeLog +++ b/apps/carcrazy/ChangeLog @@ -1,3 +1,4 @@ 0.01: Car Crazy is now avialable for testing in beta! 0.02: 10 Levels are now added making the game harder as it goes along. Some of the levels include multiple cars and faster cars. More levels coming soon. 0.03: Settings are now added so that you can reset your high score. +0.04: Minor code improvements. diff --git a/apps/carcrazy/app.js b/apps/carcrazy/app.js index 0fb765871..2bb9932a7 100644 --- a/apps/carcrazy/app.js +++ b/apps/carcrazy/app.js @@ -66,10 +66,8 @@ function moveEnemyPosition(){ enemyPositonCenterX2 = 120; }else if((randomRoadPositionIndicator2 == 3)){ enemyPositonCenterX2 = 155; - }else if(level == 7||level == 8){ - } - } + } // TODO: else if(level == 7) } function collision(){ diff --git a/apps/carcrazy/metadata.json b/apps/carcrazy/metadata.json index 3898de962..4a1b359c8 100644 --- a/apps/carcrazy/metadata.json +++ b/apps/carcrazy/metadata.json @@ -2,7 +2,7 @@ "id": "carcrazy", "name": "Car Crazy", "shortName": "Car Crazy", - "version": "0.03", + "version": "0.04", "description": "A simple car game where you try to avoid the other cars by tilting your wrist left and right. Hold down button 2 to start.", "icon": "carcrash.png", "tags": "game", diff --git a/apps/doztime/ChangeLog b/apps/doztime/ChangeLog index 77d82eff9..c3701b6d8 100644 --- a/apps/doztime/ChangeLog +++ b/apps/doztime/ChangeLog @@ -5,3 +5,4 @@ 0.05: extraneous comments and code removed display improved now supports Adjust Clock widget, if installed +0.06: minor code improvements diff --git a/apps/doztime/app-bangle1.js b/apps/doztime/app-bangle1.js index 38c5acbac..3042e9367 100644 --- a/apps/doztime/app-bangle1.js +++ b/apps/doztime/app-bangle1.js @@ -223,9 +223,8 @@ function fixTime() { Bangle.on("GPS",function cb(g) { Bangle.setGPSPower(0,"time"); Bangle.removeListener("GPS",cb); - if (!g.time || (g.time.getFullYear()<2000) || - (g.time.getFullYear()>2200)) { - } else { + if (g.time && (g.time.getFullYear()>=2000) && + (g.time.getFullYear()<=2200)) { // We have a GPS time. Set time setTime(g.time.getTime()/1000); } diff --git a/apps/doztime/metadata.json b/apps/doztime/metadata.json index a05bf1470..83be15724 100644 --- a/apps/doztime/metadata.json +++ b/apps/doztime/metadata.json @@ -2,7 +2,7 @@ "id": "doztime", "name": "Dozenal Digital Time", "shortName": "Dozenal Digital", - "version": "0.05", + "version": "0.06", "description": "A dozenal Holocene calendar and dozenal diurnal digital clock", "icon": "app.png", "type": "clock", diff --git a/apps/hwid_a_battery_widget/ChangeLog b/apps/hwid_a_battery_widget/ChangeLog index e7cdd2b4b..99601c31b 100644 --- a/apps/hwid_a_battery_widget/ChangeLog +++ b/apps/hwid_a_battery_widget/ChangeLog @@ -8,3 +8,4 @@ 0.08: Handling exceptions 0.09: Add option for showing battery high mark 0.10: Fix background color +0.11: Minor code improvements diff --git a/apps/hwid_a_battery_widget/metadata.json b/apps/hwid_a_battery_widget/metadata.json index 98d7ce2d5..2abc57a9b 100644 --- a/apps/hwid_a_battery_widget/metadata.json +++ b/apps/hwid_a_battery_widget/metadata.json @@ -3,7 +3,7 @@ "name": "A Battery Widget (with percentage) - Hanks Mod", "shortName":"H Battery Widget", "icon": "widget.png", - "version":"0.10", + "version":"0.11", "type": "widget", "supports": ["BANGLEJS", "BANGLEJS2"], "readme": "README.md", diff --git a/apps/hwid_a_battery_widget/widget.js b/apps/hwid_a_battery_widget/widget.js index 79ce9a5ad..7c76364a0 100644 --- a/apps/hwid_a_battery_widget/widget.js +++ b/apps/hwid_a_battery_widget/widget.js @@ -24,8 +24,7 @@ var s = width - 1; var x = this.x; var y = this.y; - if ((typeof x === 'undefined') || (typeof y === 'undefined')) { - } else { + if (x !== undefined && y !== undefined) { g.setBgColor(COLORS.white); g.clearRect(old_x, old_y, old_x + width, old_y + height); diff --git a/apps/novaclock/app.js b/apps/novaclock/app.js index 52bee0dbd..13cf3bfb3 100644 --- a/apps/novaclock/app.js +++ b/apps/novaclock/app.js @@ -85,7 +85,7 @@ function novaOpenEyes(speed, white, animation) { scale: 2.2 }); }, speed * 5); - } else {} + } } else { g.drawImage(novaEyesStage4(), -10, -10, { @@ -126,7 +126,7 @@ function novaOpenEyes(speed, white, animation) { }); open = true; }, speed * 5); - } else {} + } } } @@ -136,7 +136,7 @@ function novaCloseEyes(speed, white, animation) { g.drawImage(novaEyesStage0(), -10, -10, { scale: 2.2 }); - } else {} + } setTimeout(function() { g.drawImage(novaEyesStage1(), -10, -10, { scale: 2.2 @@ -164,7 +164,7 @@ function novaCloseEyes(speed, white, animation) { g.drawImage(novaEyesWhiteStage0(), -10, -10, { scale: 2.2 }); - } else {} + } setTimeout(function() { timedraw(true); g.drawImage(novaEyesTransStage1(), -10, -10, { diff --git a/apps/red7game/ChangeLog b/apps/red7game/ChangeLog index ffe131874..fffef63d5 100644 --- a/apps/red7game/ChangeLog +++ b/apps/red7game/ChangeLog @@ -4,3 +4,4 @@ 0.04: Update cards to draw rounded on newer firmware. Make sure in-game menu can't be pulled up during end of game. 0.05: add confirmation prompt to new game to prevent fat fingering new game during existing one. 0.06: fix AI logic typo and add prompt to show what AI played each turn. +0.07: Minor code improvements. diff --git a/apps/red7game/metadata.json b/apps/red7game/metadata.json index eeb1cfcb8..5f41740ed 100644 --- a/apps/red7game/metadata.json +++ b/apps/red7game/metadata.json @@ -2,7 +2,7 @@ "name": "Red 7 Card Game", "shortName" : "Red 7", "icon": "icon.png", - "version":"0.06", + "version":"0.07", "description": "An implementation of the card game Red 7 for your watch. Play against the AI and be the last player still in the game to win!", "tags": "game", "supports":["BANGLEJS2"], diff --git a/apps/red7game/red7.js b/apps/red7game/red7.js index 697d36f97..fc8116cb8 100644 --- a/apps/red7game/red7.js +++ b/apps/red7game/red7.js @@ -486,8 +486,7 @@ function canPlay(hand, palette, otherPalette) { } else { //Check if any palette play can win with rule. for(let h of hand.handCards) { - if(h === c) {} - else { + if(h !== c) { clonePalette.addCard(c); if(isWinningCombo(c, clonePalette, otherPalette)) { return true; @@ -531,8 +530,7 @@ class AI { } else { //Check if any palette play can win with rule. for(let h of this.hand.handCards) { - if(h === c) {} - else { + if(h !== c) { clonePalette.addCard(h); if(isWinningCombo(c, clonePalette, otherPalette)) { ruleStack.addCard(c); diff --git a/apps/spacew/prep/minitar.js b/apps/spacew/prep/minitar.js index 4441a1705..7ac83cb1f 100755 --- a/apps/spacew/prep/minitar.js +++ b/apps/spacew/prep/minitar.js @@ -8,8 +8,6 @@ const hs = require('./heatshrink.js'); if (pc) { fs = require('fs'); var print=console.log; -} else { - } function writeDir(json) { diff --git a/apps/tabanchi/ChangeLog b/apps/tabanchi/ChangeLog index 4e2facf6f..e5a4c8021 100644 --- a/apps/tabanchi/ChangeLog +++ b/apps/tabanchi/ChangeLog @@ -1,3 +1,4 @@ 0.01: Initial implementation 0.02: Fix app icon 0.03: Fix clock animation issue and reduce source size +0.04: Minor code improvements diff --git a/apps/tabanchi/app.js b/apps/tabanchi/app.js index f159052b7..b1a32e71b 100644 --- a/apps/tabanchi/app.js +++ b/apps/tabanchi/app.js @@ -968,8 +968,7 @@ function activateItem () { animateToClock(); break; case 0: // food - if (tama.sleep) { - } else { + if (!tama.sleep) { // evolution = 0; mode = 'food'; lightSelect = 0; @@ -979,8 +978,7 @@ function activateItem () { mode = 'light'; break; case 2: // game - if (tama.sleep) { - } else { + if (!tama.sleep) { animateToGame(); } break; diff --git a/apps/tabanchi/metadata.json b/apps/tabanchi/metadata.json index f72147162..db81707b5 100644 --- a/apps/tabanchi/metadata.json +++ b/apps/tabanchi/metadata.json @@ -2,7 +2,7 @@ "id": "tabanchi", "name": "Tabanchi", "shortName": "Tabanchi", - "version": "0.03", + "version": "0.04", "type": "app", "description": "Tamagotchi WatchApp", "icon": "app.png",