about summary refs log tree commit diff
path: root/src/ci
diff options
context:
space:
mode:
authorLeón Orell Valerian Liehr <me@fmease.dev>2025-01-29 06:03:22 +0100
committerGitHub <noreply@github.com>2025-01-29 06:03:22 +0100
commit3cc6ea2ac6e5f903cb00d9dd126c519ab89f5e3b (patch)
tree168c6484d9686b71a134333e2a1e6897c1e5cc76 /src/ci
parentdbc204d5d5242afe52ac5725e7cd799d9c9c7c65 (diff)
parentd94b64dcefcdf4ad29e8d5f8240389d9506968e5 (diff)
downloadrust-3cc6ea2ac6e5f903cb00d9dd126c519ab89f5e3b.tar.gz
rust-3cc6ea2ac6e5f903cb00d9dd126c519ab89f5e3b.zip
Rollup merge of #136161 - notriddle:typescript, r=GuillaumeGomez
rustdoc: add nobuild typescript checking to our JS

By nobuild, I mean that the type annotations are all [in comments], not in the "native" typescript syntax. This is a bit uglier, but it lets you rapid-prototype without tsc, works with all the native browser debugging tools, and keeps Node out of Rust's bootstrap chain.

[in comments]: https://news.ycombinator.com/item?id=35892250

This pull request mostly just adds ts-ignore annotations and type declarations. To actually take good advantage of typescript, we'll want to "burn down" this pile of unsafe code until we eventually have a version with almost none of these.

This PR also adds tsc to the mingw-check Dockerfile, so that it can't fall out of date like the Closure annotations did.

https://rust-lang.zulipchat.com/#narrow/channel/266220-t-rustdoc/topic/typescript

r? `@GuillaumeGomez` `@lolbinarycat`
Diffstat (limited to 'src/ci')
-rw-r--r--src/ci/docker/host-x86_64/mingw-check/Dockerfile5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/ci/docker/host-x86_64/mingw-check/Dockerfile b/src/ci/docker/host-x86_64/mingw-check/Dockerfile
index d408cd518a0..9234c6dc921 100644
--- a/src/ci/docker/host-x86_64/mingw-check/Dockerfile
+++ b/src/ci/docker/host-x86_64/mingw-check/Dockerfile
@@ -29,7 +29,7 @@ ENV PATH="/node/bin:${PATH}"
 
 # Install es-check
 # Pin its version to prevent unrelated CI failures due to future es-check versions.
-RUN npm install es-check@6.1.1 eslint@8.6.0 -g
+RUN npm install es-check@6.1.1 eslint@8.6.0 typescript@5.7.3 -g
 
 COPY scripts/sccache.sh /scripts/
 RUN sh /scripts/sccache.sh
@@ -68,4 +68,5 @@ ENV SCRIPT \
            es-check es2019 ../src/librustdoc/html/static/js/*.js && \
            eslint -c ../src/librustdoc/html/static/.eslintrc.js ../src/librustdoc/html/static/js/*.js && \
            eslint -c ../src/tools/rustdoc-js/.eslintrc.js ../src/tools/rustdoc-js/tester.js && \
-           eslint -c ../src/tools/rustdoc-gui/.eslintrc.js ../src/tools/rustdoc-gui/tester.js
+           eslint -c ../src/tools/rustdoc-gui/.eslintrc.js ../src/tools/rustdoc-gui/tester.js && \
+           tsc --project ../src/librustdoc/html/static/js/tsconfig.json