From: Raphaƫl Jakse Date: Sun, 12 Apr 2020 18:14:16 +0000 (+0200) Subject: Lint X-Git-Url: https://secure.softndesign.org/git/?a=commitdiff_plain;h=3a663a272baae08c24d5725233333a63fb38fd16;p=trivabble.git Lint --- diff --git a/.eslintrc.json b/.eslintrc.json index c89b2bb..e391e59 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -66,7 +66,7 @@ "curly": "error", "default-case": "off", "default-param-last": "error", - "dot-location": "error", + "dot-location": ["error", "property"], "dot-notation": "error", "eol-last": "error", "eqeqeq": "error", @@ -88,7 +88,11 @@ "id-length": "off", "id-match": "error", "implicit-arrow-linebreak": "error", - "indent": "off", + "indent": [ + "error", 4, { + "SwitchCase": 1 + } + ], "indent-legacy": "off", "init-declarations": "off", "jsx-quotes": "error", diff --git a/alert.js b/alert.js index 9f534c2..d31cdc2 100644 --- a/alert.js +++ b/alert.js @@ -3,11 +3,18 @@ (function (global) { "use strict"; - var divAlert, divAlertInput, divAlertConfirm, divAlertButton, alertButtonOK, - divAlertCallback, divAlertCallbackYes, divAlertCallbackNo, alertInput, - divAlertContent; - - var _ = (window.libD && libD.l10n) ? libD.l10n() : function (s) {return s;}; + let divAlert; + let divAlertInput; + let divAlertConfirm; + let divAlertButton; + let alertButtonOK; + let divAlertCallback; + let divAlertCallbackYes; + let divAlertCallbackNo; + let alertInput; + let divAlertContent; + + const _ = (window.libD && libD.l10n) ? libD.l10n() : function (s) {return s;}; function promptOK() { divAlert.style.display = "none"; @@ -90,7 +97,7 @@ alertButtonOK.textContent = _("OK"); alertButtonOK.onclick = alertOK; - var divAlertOuter = document.createElement("div"); + const divAlertOuter = document.createElement("div"); divAlertOuter.className = "alert-outer"; divAlertOuter.appendChild(divAlertContent); divAlertOuter.appendChild(divAlertInput); diff --git a/trivabble-server.js b/trivabble-server.js index 24f6b5f..61a4cf0 100644 --- a/trivabble-server.js +++ b/trivabble-server.js @@ -23,7 +23,7 @@ * @source: https://gitlab.com/raphj/trivabble/ */ - /*eslint strict: [2, "global"]*/ +/*eslint strict: [2, "global"]*/ "use strict"; diff --git a/trivabble.js b/trivabble.js index 4281e37..cdc5ab1 100644 --- a/trivabble.js +++ b/trivabble.js @@ -1047,17 +1047,15 @@ let tile; myConfirm( _("Are you sure you want to put all your tiles back in the bag?"), function () { - sendCmds( - [ - {cmd: "moveLetter", from: "rack", indexFrom: 0, to: "bag", indexTo: -1}, - {cmd: "moveLetter", from: "rack", indexFrom: 1, to: "bag", indexTo: -1}, - {cmd: "moveLetter", from: "rack", indexFrom: 2, to: "bag", indexTo: -1}, - {cmd: "moveLetter", from: "rack", indexFrom: 3, to: "bag", indexTo: -1}, - {cmd: "moveLetter", from: "rack", indexFrom: 4, to: "bag", indexTo: -1}, - {cmd: "moveLetter", from: "rack", indexFrom: 5, to: "bag", indexTo: -1}, - {cmd: "moveLetter", from: "rack", indexFrom: 6, to: "bag", indexTo: -1} - ] - ); + sendCmds([ + {cmd: "moveLetter", from: "rack", indexFrom: 0, to: "bag", indexTo: -1}, + {cmd: "moveLetter", from: "rack", indexFrom: 1, to: "bag", indexTo: -1}, + {cmd: "moveLetter", from: "rack", indexFrom: 2, to: "bag", indexTo: -1}, + {cmd: "moveLetter", from: "rack", indexFrom: 3, to: "bag", indexTo: -1}, + {cmd: "moveLetter", from: "rack", indexFrom: 4, to: "bag", indexTo: -1}, + {cmd: "moveLetter", from: "rack", indexFrom: 5, to: "bag", indexTo: -1}, + {cmd: "moveLetter", from: "rack", indexFrom: 6, to: "bag", indexTo: -1} + ]); } ); }