Lint
authorRaphaël Jakse <raphael.trivabble@jakse.fr>
Sun, 12 Apr 2020 18:14:16 +0000 (20:14 +0200)
committerRaphaël Jakse <raphael.trivabble@jakse.fr>
Sun, 12 Apr 2020 18:14:16 +0000 (20:14 +0200)
.eslintrc.json
alert.js
trivabble-server.js
trivabble.js

index c89b2bb1875acbd8d63b14a195371971ac7497a7..e391e59dc1f33b65e0be62b18a0e945a93301541 100644 (file)
@@ -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",
         "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",
index 9f534c22a5dc7752a3b5b5eebd51f1ef20fe239e..d31cdc2e8682a4a38f57d60c7a8e1fd3e86937ee 100644 (file)
--- 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);
index 24f6b5fae914bdb9214988e438f94fb024fdb40b..61a4cf024efe9f431413ff12a7d0d04e7373cae9 100644 (file)
@@ -23,7 +23,7 @@
  * @source: https://gitlab.com/raphj/trivabble/
  */
 
- /*eslint strict: [2, "global"]*/
+/*eslint strict: [2, "global"]*/
 
 "use strict";
 
index 4281e37aae4bc0b78836fc0f848d5204535c331e..cdc5ab13d2bff7ae251297d4b0647946f143129e 100644 (file)
@@ -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}
+                ]);
             }
         );
     }