about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2025-06-22 17:35:37 +0200
committerGitHub <noreply@github.com>2025-06-22 17:35:37 +0200
commit8da1a6290d0a097a497e109e70651c4f55e0fadb (patch)
tree122849369a503be18a7587fa6e2474801bf6c860
parent1474a0f505d048cc70064b0c3be8ba7b7bf59657 (diff)
parent90524da730f3682ec13da52ef8dc2b26a42e0fb0 (diff)
downloadrust-8da1a6290d0a097a497e109e70651c4f55e0fadb.tar.gz
rust-8da1a6290d0a097a497e109e70651c4f55e0fadb.zip
Rollup merge of #142877 - yotamofek:pr/rustdoc/comment-eslint-installation-req, r=GuillaumeGomez
Document why tidy checks if `eslint` is installed via `npm`

Discussion here: rust-lang/rust#142851
-rw-r--r--src/tools/tidy/src/rustdoc_js.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/tools/tidy/src/rustdoc_js.rs b/src/tools/tidy/src/rustdoc_js.rs
index 2517e2de12c..720f0712ee0 100644
--- a/src/tools/tidy/src/rustdoc_js.rs
+++ b/src/tools/tidy/src/rustdoc_js.rs
@@ -62,6 +62,9 @@ pub fn check(librustdoc_path: &Path, tools_path: &Path, src_path: &Path, bad: &m
             return;
         }
     };
+    // Having the correct `eslint` version installed via `npm` isn't strictly necessary, since we're invoking it via `npx`,
+    // but this check allows the vast majority that is not working on the rustdoc frontend to avoid the penalty of running
+    // `eslint` in tidy. See also: https://github.com/rust-lang/rust/pull/142851
     match get_eslint_version() {
         Some(version) => {
             if version != eslint_version {