Skip to content

Commit 6982c36

Browse files
committed
rustdoc: document JS/TS checks via tidy; move note out of GUI test doc
1 parent d914160 commit 6982c36

File tree

2 files changed

+11
-28
lines changed

2 files changed

+11
-28
lines changed

src/rustdoc-internals/rustdoc-gui-test-suite.md

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -7,34 +7,6 @@ For other rustdoc-specific test suites, see [Rustdoc test suites].
77

88
These use a NodeJS-based tool called [`browser-UI-test`] that uses [puppeteer] to run tests in a headless browser and check rendering and interactivity. For information on how to write this form of test, see [`tests/rustdoc-gui/README.md`][rustdoc-gui-readme] as well as [the description of the `.goml` format][goml-script]
99

10-
### Rustdoc frontend checks in CI (ESLint & TypeScript)
11-
12-
Rustdoc's JS/TS **linting and type-checking** are **not** performed by `compiletest`. In CI they run under the tidy "extra checks" step, which invokes ESLint and `tsc` on rustdoc's frontend sources.
13-
14-
To reproduce locally (mirrors CI behavior for rustdoc's frontend suites):
15-
16-
```bash
17-
./x.py test --stage 2 tests/rustdoc-js
18-
./x.py test --stage 2 tests/rustdoc-js-std
19-
./x.py test --stage 2 tests/rustdoc-gui
20-
```
21-
22-
You can also run the linters directly in the frontend sources:
23-
24-
```bash
25-
cd rust/src/librustdoc/html/static/js
26-
npm ci
27-
npx tsc -p tsconfig.json
28-
npx eslint .
29-
```
30-
31-
**Notes**
32-
33-
On macOS you may see small pixel/position diffs that fail some rustdoc-gui tests locally; CI's Linux baseline is authoritative.
34-
35-
Running `npx tsc` directly depends on your local TypeScript environment (DOM vs Node types). Prefer the suites above when in doubt.
36-
37-
In CI, these checks run inside the dedicated "tidy" job (see the "tidy" job in GitHub Actions). It installs tidy and runs `./x.py test tidy -vv`, which triggers the ESLint/TypeScript steps described above.
3810

3911
[Rustdoc test suites]: ../tests/compiletest.md#rustdoc-test-suites
4012
[`browser-UI-test`]: https://github.com/GuillaumeGomez/browser-UI-test/

src/rustdoc.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,17 @@ does is call the `main()` that's in this crate's `lib.rs`, though.)
6060
* Use `./x test tests/rustdoc*` to run the tests using a stage1
6161
rustdoc.
6262
* See [Rustdoc internals] for more information about tests.
63+
* Use `./x test tidy --extra-checks=js` to run ESLint/TSC checks on rustdoc's frontend code.
64+
65+
### Frontend CI checks
66+
67+
Rustdoc's JavaScript and TypeScript are checked by ESLint and `tsc` during CI, not by compiletest. These run as part of the tidy job:
68+
69+
```bash
70+
./x.py test tidy --extra-checks=js
71+
```
72+
73+
The `--extra-checks=js` flag enables the frontend linting that runs in CI.
6374

6475
[`bootstrap.toml`]: ./building/how-to-build-and-run.md
6576

0 commit comments

Comments
 (0)