about summary refs log tree commit diff
path: root/src/librustdoc/html/static
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2022-06-07 01:13:47 +0200
committerGitHub <noreply@github.com>2022-06-07 01:13:47 +0200
commit6be8b9cd775282322767ecafb790405602c94261 (patch)
tree787fc63b7affecf18f28c14c2081d5eba60ff3d3 /src/librustdoc/html/static
parentc4bfd106e19d3a6a67d45a9b13059bcc75792409 (diff)
parentcd5e73be3f10e78fb603f7dd3c673e4959f0bed0 (diff)
downloadrust-6be8b9cd775282322767ecafb790405602c94261.tar.gz
rust-6be8b9cd775282322767ecafb790405602c94261.zip
Rollup merge of #97792 - GuillaumeGomez:eslint-checks, r=Dylan-DPC
More eslint checks

Here is the list of newly added eslint checks:

 * [no-confusing-arrow](https://eslint.org/docs/rules/no-confusing-arrow)
 * [no-div-regex](https://eslint.org/docs/rules/no-div-regex)
 * [no-floating-decimal](https://eslint.org/docs/rules/no-floating-decimal)
 * [no-implicit-globals](https://eslint.org/docs/rules/no-implicit-globals)
 * [no-implied-eval](https://eslint.org/docs/rules/no-implied-eval)
 * [no-label-var](https://eslint.org/docs/rules/no-label-var)

Since you already reviewed the previous ones:

r? `@Dylan-DPC`
Diffstat (limited to 'src/librustdoc/html/static')
-rw-r--r--src/librustdoc/html/static/.eslintrc.js6
-rw-r--r--src/librustdoc/html/static/js/main.js2
2 files changed, 7 insertions, 1 deletions
diff --git a/src/librustdoc/html/static/.eslintrc.js b/src/librustdoc/html/static/.eslintrc.js
index bd83b254caa..9088e06e508 100644
--- a/src/librustdoc/html/static/.eslintrc.js
+++ b/src/librustdoc/html/static/.eslintrc.js
@@ -78,5 +78,11 @@ module.exports = {
         "block-scoped-var": "error",
         "guard-for-in": "error",
         "no-alert": "error",
+        "no-confusing-arrow": "error",
+        "no-div-regex": "error",
+        "no-floating-decimal": "error",
+        "no-implicit-globals": "error",
+        "no-implied-eval": "error",
+        "no-label-var": "error",
     }
 };
diff --git a/src/librustdoc/html/static/js/main.js b/src/librustdoc/html/static/js/main.js
index 548aeedd033..414bca850e3 100644
--- a/src/librustdoc/html/static/js/main.js
+++ b/src/librustdoc/html/static/js/main.js
@@ -882,7 +882,7 @@ function loadCss(cssFileName) {
             ["-", "Collapse all sections"],
         ].map(x => "<dt>" +
             x[0].split(" ")
-                .map((y, index) => (index & 1) === 0 ? "<kbd>" + y + "</kbd>" : " " + y + " ")
+                .map((y, index) => ((index & 1) === 0 ? "<kbd>" + y + "</kbd>" : " " + y + " "))
                 .join("") + "</dt><dd>" + x[1] + "</dd>").join("");
         const div_shortcuts = document.createElement("div");
         addClass(div_shortcuts, "shortcuts");