From: Raphaƫl Jakse Date: Sat, 4 Apr 2020 16:08:28 +0000 (+0200) Subject: Linting X-Git-Url: https://secure.softndesign.org/git/?a=commitdiff_plain;h=0a13023bfbc2deb1fec2ad82596b6e218c0de878;p=trivabble.git Linting --- diff --git a/.eslintrc.json b/.eslintrc.json index 72837bb..42d51ba 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -265,7 +265,10 @@ "require-jsdoc": "off", "require-unicode-regexp": "error", "rest-spread-spacing": "error", - "semi": "off", + "semi": [ + "error", + "always" + ], "semi-spacing": [ "error", { diff --git a/trivabble-server.js b/trivabble-server.js index 6700699..504b21c 100644 --- a/trivabble-server.js +++ b/trivabble-server.js @@ -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), diff --git a/trivabble.js b/trivabble.js index e5b0747..a7ddc12 100644 --- a/trivabble.js +++ b/trivabble.js @@ -566,7 +566,7 @@ }, row.lastChild.textContent ); - } + }; } )(row); @@ -644,7 +644,7 @@ while (participants.rows[1]) { participants.removeChild(participants.rows[1]); } - sendCmds([{"cmd":"hello"}]) + sendCmds([{"cmd":"hello"}]); break; case "moveLetter": @@ -676,7 +676,7 @@ setTimeout(sendCmds.bind(null, []), POLLING_DELAY); } else { retriedImmediately = true; - sendCmds() + sendCmds(); } } @@ -901,7 +901,7 @@ [{cmd: "resetGame"}] ); } - ) + ); } function clearRack() {