about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJacob Pratt <jacob@jhpratt.dev>2025-06-17 23:19:38 +0200
committerGitHub <noreply@github.com>2025-06-17 23:19:38 +0200
commita47b364dc62be37f84547a81ef83208af24f9876 (patch)
tree6428ddf8a86dfed423851f33ea5d295ae0544e54
parent6acda82078f75e8e5eb3a4978f8dec1a3a87e02d (diff)
parent2bbc974bede2f23953aa5fc81d6399811ab47400 (diff)
downloadrust-a47b364dc62be37f84547a81ef83208af24f9876.tar.gz
rust-a47b364dc62be37f84547a81ef83208af24f9876.zip
Rollup merge of #142618 - GuillaumeGomez:eslint-no-console, r=lolbinarycat
Lint about `console` calls in rustdoc JS

As discussed [here](https://github.com/rust-lang/rust/pull/142100#discussion_r2151764395), this PR enforces that `console` is not used in rustdoc JS by default.

cc `@lolbinarycat`
-rw-r--r--src/librustdoc/html/static/.eslintrc.js1
-rw-r--r--src/librustdoc/html/static/js/search.js1
2 files changed, 2 insertions, 0 deletions
diff --git a/src/librustdoc/html/static/.eslintrc.js b/src/librustdoc/html/static/.eslintrc.js
index fbb096fe9c7..303c5667140 100644
--- a/src/librustdoc/html/static/.eslintrc.js
+++ b/src/librustdoc/html/static/.eslintrc.js
@@ -91,5 +91,6 @@ module.exports = {
         "no-script-url": "error",
         "no-sequences": "error",
         "no-div-regex": "error",
+        "no-console": "error",
     }
 };
diff --git a/src/librustdoc/html/static/js/search.js b/src/librustdoc/html/static/js/search.js
index dce5fddb317..b611a3e501d 100644
--- a/src/librustdoc/html/static/js/search.js
+++ b/src/librustdoc/html/static/js/search.js
@@ -1133,6 +1133,7 @@ class RoaringBitmap {
         }
         for (let j = 0; j < size; ++j) {
             if (offsets && offsets[j] !== i) {
+                // eslint-disable-next-line no-console
                 console.log(this.containers);
                 throw new Error(`corrupt bitmap ${j}: ${i} / ${offsets[j]}`);
             }