chore(rustdoc): refresh JS toolchain with Vite+#157907
Conversation
|
cc @rust-lang/rust-analyzer Some changes occurred in HTML/CSS/JS. cc @GuillaumeGomez, @lolbinarycat
|
|
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @notriddle (or someone else) some time within the next two weeks. Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (
Why was this reviewer chosen?The reviewer was selected based on:
|
This comment has been minimized.
This comment has been minimized.
|
For rust-analyzer what the bot said, but please split it in multiple PRs. |
|
And please shquash/rebase the rust-analyzer changes out of the history instead of reverting them. |
ee75903 to
378cd2d
Compare
| .map((s) => { | ||
| // https://github.com/rust-lang/rust/issues/119219 | ||
| const pair = s.split("=").map(x => x.replace(/\+/g, " ")); | ||
| const pair = s.split("=").map((x) => x.replace(/\+/g, " ")); |
There was a problem hiding this comment.
Adding parens around single arg for closure is not great. :-/
|
|
||
| const rootPath = getVar("root-path"); | ||
| (function () { | ||
| const rootPath = getVar("root-path"); |
There was a problem hiding this comment.
We didn't indent on purpose. ^^'
|
Also before going any further: why should we use vite+ instead or yarn/npm? What are the gains from this switch? Nothing in your description is telling us that. |
378cd2d to
7911084
Compare
|
Judging by the 10k contributions in the last year... This is AI-generated. |
|
Noted. |
|
So in this case, since there is no provided argument as to why we should switch to this tool, I'm going to close it. Feel free to open a thread on our zulip if you want it to be discussed again. |
This PR refreshes the JavaScript tooling used by rustdoc JS tidy checks.
Vite+ | The Unified Toolchain for the Web
https://viteplus.dev/
Powered by Rust, MIT
https://github.com/voidzero-dev/vite-plus
What changed
vite.config.ts.vp fmt --checkbeforevp lintfor rustdoc JavaScript.es-checkandtscchecks in the tidy path.tabWidth: 4,printWidth: 100, andarrowParens: "avoid".Why
./x test tidy --extra-checks=jsworkflow.vite.config.tsfiles instead of separate ESLint config files.arrowParens: "avoid"preserves the previous single-argument arrow style from the ESLintarrow-parens: as-neededrule.Review notes
The formatter intentionally excludes
js/search.jsandjs/src-script.js. Those files wrap large bodies in a function while keeping the body visually at top-level indentation, and oxfmt currently does not have a setting to preserve that layout. They are still covered by the Oxlint,es-check, andtsctidy checks.The remaining oxfmt diff is mechanical formatting output: function spacing, wrapping, object formatting, and TypeScript suppression comments adjusted after formatting.
The functional tidy changes are concentrated in the Vite+ configs and
src/tools/tidy/src/extra_checks/rustdoc_js.rs.The rust-analyzer VS Code extension changes were removed from this PR in response to review feedback. They should be proposed separately against the rust-analyzer workflow instead of being bundled with this rustdoc/tidy change.
Validation
./x test tidy --extra-checks=jsnode_modulesdirectory temporarily moved aside, matching CI's dependency layout where JS packages are installed underbuild/node_modules.