Linting
authorRaphaël Jakse <raphael.jakse@univ-grenoble-alpes.fr>
Sat, 4 Apr 2020 16:08:28 +0000 (18:08 +0200)
committerRaphaël Jakse <raphael.jakse@univ-grenoble-alpes.fr>
Sat, 4 Apr 2020 16:08:28 +0000 (18:08 +0200)
.eslintrc.json
trivabble-server.js
trivabble.js

index 72837bbd41cb810375d63b2ceb809162ffe47f6f..42d51ba0fd562bf8b89732e61f6825476f74bfe7 100644 (file)
         "require-jsdoc": "off",
         "require-unicode-regexp": "error",
         "rest-spread-spacing": "error",
-        "semi": "off",
+        "semi": [
+            "error",
+            "always"
+        ],
         "semi-spacing": [
             "error",
             {
index 6700699d37724f54c8441adaea25038da6be8922..504b21c85c13ea76c36b4675c930c19b15fb2a46 100644 (file)
@@ -155,7 +155,7 @@ function keepAlive(responseAndIsES) {
             responseAndIsES[1]
                 ? ":\n\n"
                 : "2[]"
-        )
+        );
     }, KEEP_ALIVE);
 }
 
@@ -240,22 +240,18 @@ Game.prototype.playerJoined = function (playerName) {
     for (var player in this.racks) {
         if (Object.prototype.hasOwnProperty.call(this.racks, player)) {
             player = player.slice(1); // '#'
-            players.push(
-                {
-                    player: player,
-                    score: this.getPlayerScore(player),
-                    rackCount: countTiles(this.getPlayerRack(player))
-                }
-            );
+            players.push({
+                player: player,
+                score: this.getPlayerScore(player),
+                rackCount: countTiles(this.getPlayerRack(player))
+            });
         }
     }
 
-    this.pendingEvents.push(
-        {
-            players: players,
-            date: dateNow
-        }
-    );
+    this.pendingEvents.push({
+        players: players,
+        date: dateNow
+    });
 };
 
 Game.prototype.addListeningPlayer = function (playerName, responseAndIsES) {
@@ -435,7 +431,7 @@ function handleCommand(cmd, gameNumber, playerName, response) {
 
             response.write(
                 JSON.stringify({
-                    "error":0,
+                    "error": 0,
                     "gameNumber": gameNumber,
                     "playerName": playerName,
                     "rack": game.getPlayerRack(playerName),
index e5b0747102f3d02d9f5621d886508adb0afc1022..a7ddc12bfcf647867cefdb131995769a3f943c63 100644 (file)
                                     },
                                     row.lastChild.textContent
                                 );
-                            }
+                            };
                         }
                     )(row);
 
                 while (participants.rows[1]) {
                     participants.removeChild(participants.rows[1]);
                 }
-                sendCmds([{"cmd":"hello"}])
+                sendCmds([{"cmd":"hello"}]);
                 break;
 
             case "moveLetter":
             setTimeout(sendCmds.bind(null, []), POLLING_DELAY);
         } else {
             retriedImmediately = true;
-            sendCmds()
+            sendCmds();
         }
     }
 
                     [{cmd: "resetGame"}]
                 );
             }
-        )
+        );
     }
 
     function clearRack() {