Docs: fix all broken anchors, and fail the build on new ones - #1922
Closed
robhogan wants to merge 1 commit into
Closed
Docs: fix all broken anchors, and fail the build on new ones#1922robhogan wants to merge 1 commit into
robhogan wants to merge 1 commit into
Conversation
The website build reports ten broken anchors and ships anyway. Fix them, and set `onBrokenAnchors: 'throw'` so the next one fails the build instead of accumulating. Most are stale or mistyped anchors: | link | fixed to | |---|---| | `#require-resolveweak` | `#requireresolveweak` | | `#extranodemodules` | `#extranodemodules-string-string` | | `#disableHierarchicalLookup-boolean` | `#disablehierarchicallookup-boolean` | | `#resolve_package-exports` | `#resolve_package_exports` | | `#doesfileexist-string--boolean` | `#doesfileexist-string--boolean-deprecated` | | `#dev` | `#dev-boolean` | | `configuration#resolvereqeuest` | `configuration#resolverequest` | Two were not just anchors: - `context.enablePackageExports` has been `unstable_enablePackageExports` since it was introduced, and the link pointed at a heading that never existed on that page. Corrected the name in both prose and link, and pointed it at the config entry, matching how RESOLVE_PACKAGE_EXPORTS already refers to it. - `resolver.assetResolutions` is a real option (`metro-config/src/types.js`) with three inbound doc links but no entry in Configuration.md. Documented it. Changelog: [Internal]
Contributor
|
@vzaidman has imported this pull request. If you are a Meta employee, you can view this in D119472681. |
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The website build reports ten broken anchors and ships anyway. Fix them, and set
onBrokenAnchors: 'throw'so the next one fails the build instead of accumulating.Most are stale or mistyped anchors:
#require-resolveweak#requireresolveweak#extranodemodules#extranodemodules-string-string#disableHierarchicalLookup-boolean#disablehierarchicallookup-boolean#resolve_package-exports#resolve_package_exports#doesfileexist-string--boolean#doesfileexist-string--boolean-deprecated#dev#dev-booleanconfiguration#resolvereqeuestconfiguration#resolverequestTwo were not just anchors:
context.enablePackageExportshas beenunstable_enablePackageExportssince it was introduced, and the link pointed at a heading that never existed on that page. Corrected the name in both prose and link, and pointed it at the config entry, matching how RESOLVE_PACKAGE_EXPORTS already refers to it.resolver.assetResolutionsis a real option (metro-config/src/types.js) with three inbound doc links but no entry in Configuration.md. Documented it, with the default and the@${resolution}xfilename form the defaultresolveAssetuses.Note this includes the
resolvereqeuestfix also made by #1755, which additionally fixes some code comment typos.Test plan
yarn buildinwebsite/passes with no broken anchors reported.Confirmed
onBrokenAnchors: 'throw'actually takes effect: adding a deliberate#this-anchor-does-not-existlink fails the build withDocusaurus found broken anchors!, and removing it passes again.