From: Raphaƫl Jakse Date: Mon, 27 Apr 2020 17:57:45 +0000 (+0200) Subject: Lint X-Git-Url: https://secure.softndesign.org/git/?a=commitdiff_plain;h=35c635571fb962f4862e5165e1d43c28bb29d76a;p=trivabble.git Lint --- diff --git a/.eslintrc.json b/.eslintrc.json index e391e59..0308c1d 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -39,10 +39,7 @@ ], "callback-return": "error", "camelcase": "error", - "capitalized-comments": [ - "error", - "always" - ], + "capitalized-comments": "off", "class-methods-use-this": "error", "comma-dangle": "error", "comma-spacing": [ diff --git a/trivabble-server.js b/trivabble-server.js index 6a56e60..8157cc4 100644 --- a/trivabble-server.js +++ b/trivabble-server.js @@ -555,7 +555,9 @@ function handleCommand(cmdNumber, message, response) { } letter = rack[cmd.indexFrom]; - operations.push(() => {rack[cmd.indexFrom] = "";}); + operations.push(() => { + rack[cmd.indexFrom] = ""; + }); break; case "board": @@ -574,7 +576,9 @@ function handleCommand(cmdNumber, message, response) { return false; } - operations.push(() => {letter = game.bagPopLetter(playerName);}); + operations.push(() => { + letter = game.bagPopLetter(playerName); + }); break; default: @@ -596,7 +600,9 @@ function handleCommand(cmdNumber, message, response) { return false; } - operations.push(() => {rack[cmd.indexTo] = letter;}); + operations.push(() => { + rack[cmd.indexTo] = letter; + }); break; case "board": @@ -623,8 +629,8 @@ function handleCommand(cmdNumber, message, response) { response.write( JSON.stringify({ - error:0, - rack: (cmd.from === "bag" && cmd.to === "rack") ? rack : undefined, + error: 0, + rack: (cmd.from === "bag" && cmd.to === "rack") ? rack : undefined, // eslint-disable-line no-undefined remainingLetters: game.bag.length }) ); diff --git a/trivabble.js b/trivabble.js index e832002..b5b5026 100644 --- a/trivabble.js +++ b/trivabble.js @@ -43,7 +43,9 @@ setConf("MAX_WEBSOCKET_ERRORS", 1); setConf("APP_PATH", ""); - const _ = (window.libD && libD.l10n) ? libD.l10n() : function (s) {return s;}; + const _ = (window.libD && libD.l10n) ? libD.l10n() : function (s) { + return s; + }; const trivabble = window.trivabble = {l10n: _}; @@ -235,11 +237,11 @@ if (moveCMD.to === moveCMD.from) { if (moveCMD.indexTo !== moveCMD.indexFrom) { - if (moveCMD.from === "rack") { - sendCmds([moveRack]); - } else { - sendCmds([moveCMD]); - } + sendCmds([ + (moveCMD.from === "rack") + ? moveRack + : moveCMD + ]); } } else if (moveCMD.to === "rack") { moveRack.rack[moveCMD.indexTo] = ""; @@ -1300,7 +1302,7 @@ type: "rack", rack: letters.map( function (tile) { - return tile.querySelector(".tile-letter").textContent + return tile.querySelector(".tile-letter").textContent; } ) }