fix lintian errors
authorLaurent Mazet <mazet@softndesign.org>
Fri, 14 Feb 2025 18:21:13 +0000 (19:21 +0100)
committerLaurent Mazet <mazet@softndesign.org>
Fri, 14 Feb 2025 18:21:13 +0000 (19:21 +0100)
public/trivabble.js
server/trivabble-server.js

index 8941d98b91df9a48300dc235481136ccaa9c44ef..2cdd6ad36dd9bd05482f24bb864ec02222637642 100644 (file)
             if (Object.prototype.hasOwnProperty.call(player, "leave")) {
                 tablePlayers[playerName].remove();
                 delete (tablePlayers[playerName]);
+                // eslint-disable-next-line no-continue
                 continue;
             }
 
index 898d274f0f627a626a4b145eabc58b7b9c68838f..0f90f91d74e83edfbaaffa08611695bf2341e4e1 100644 (file)
@@ -112,7 +112,7 @@ function expandAndShuffleBag(bag, factor) {
         factor--;
     }
     if (Math.round(bag.length * factor) > 0) {
-        let shuffleBag = bag.slice();
+        const shuffleBag = bag.slice();
         shuffleInPlace(shuffleBag);
         newBag = newBag.concat(shuffleBag.slice(0, Math.round(shuffleBag.length * factor)));
     }
@@ -339,13 +339,13 @@ Game.prototype.playerJoined = function (playerName) {
 Game.prototype.playerLeft = function (playerName) {
 
     const playerID = "#" + playerName;
-    delete (this.racks[playerID])
-    delete (this.scores[playerID])
+    delete (this.racks[playerID]);
+    delete (this.scores[playerID]);
     for (const listeningPlayer of this.listeningPlayers) {
         writeMessage(listeningPlayer,
             JSON.stringify({players: [{player: playerName, leave: "yes"}]}));
     }
-    if (Object.keys(this.racks).length == 0) {
+    if (Object.keys(this.racks).length === 0) {
         for (const gameID of Object.keys(games)) {
             if (games[gameID] === this) {
                 delete (games[gameID]);