about summary refs log tree commit diff
path: root/src/librustdoc/html/static/js/src-script.js
diff options
context:
space:
mode:
authorMichael Howell <michael@notriddle.com>2025-01-13 15:20:36 -0700
committerMichael Howell <michael@notriddle.com>2025-01-27 19:20:09 -0700
commitd94b64dcefcdf4ad29e8d5f8240389d9506968e5 (patch)
tree78df20063f42b06872714854a4f19d09dbc40c71 /src/librustdoc/html/static/js/src-script.js
parent2f348cb7ce4063fa4eb40038e6ada3c5214717bd (diff)
downloadrust-d94b64dcefcdf4ad29e8d5f8240389d9506968e5.tar.gz
rust-d94b64dcefcdf4ad29e8d5f8240389d9506968e5.zip
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.

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
Diffstat (limited to 'src/librustdoc/html/static/js/src-script.js')
-rw-r--r--src/librustdoc/html/static/js/src-script.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/librustdoc/html/static/js/src-script.js b/src/librustdoc/html/static/js/src-script.js
index 3003f4c1503..8f712f4c20c 100644
--- a/src/librustdoc/html/static/js/src-script.js
+++ b/src/librustdoc/html/static/js/src-script.js
@@ -5,6 +5,9 @@
 /* global addClass, onEachLazy, removeClass, browserSupportsHistoryApi */
 /* global updateLocalStorage, getVar */
 
+// Eventually fix this.
+// @ts-nocheck
+
 "use strict";
 
 (function() {