Repository navigation
Conversation
Replace the owned Markdown parser, heading slugger and fragment resolver in scripts/check-local-links.ts with remark-validate-links, run offline through unified-engine (repository: false). The script keeps only the URLCode rules: retired repositories, local issue trackers, shipped package links, pinned blob/tree v<current version> links, explicit <a id> anchors, Markdown-only fragments and the historical markers. Tests are ported to fixture checkouts. Co-Authored-By: Claude Opus 5.5 <[email protected]>
jimhoyd
enabled auto-merge (squash)
September 30, 2026 13:26
jimhoyd
disabled auto-merge
September 30, 2026 13:26
Collaborator
Author
|
Closed by owner decision (#1041): the swap removed ~190 lines of owned code but added 166 dev packages (~2,400 lockfile lines). Too lopsided for a docs check; the owned checker stays. |
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.
Part of #1041 (item 4).
scripts/check-local-links.tsno longer owns a Markdown link parser, a GitHub heading slugger or a fragment resolver. Those now come from remark-validate-links (MIT), run through unified-engine withrepository: false. That setting means it runs nogit remoteand makes no network request. The script keeps only the rules a generic tool can't express. It still runs innpm run check:docs.Where each existing rule went
missing-file, reported asdead-relative-link)-1/-2for repeated headings, setext headings, headings in fenced code ignoredgithub-slugger, reported asdead-fragment)<a id>/<a name>anchorshProperties.idon the html node, which the tool then counts.mdtargets (file.ts#L10and directory fragments skipped); percent-encoded fragments decodedblob/v<current>andtree/v<current>links checked against the checkout; other versions and other sites skippedblob/main/tree/main, or a path outside the package, in a file a package shipsjimhoyd-com/urlcode-<package>)issues/,backlog/,ISSUES.md,BACKLOG.md)<!-- local-links: historical -->(line or paragraph) andhistorical-file.mdplus rootllms.txt, skippingnode_modules/dist/build/coverage/dotted dirsChanges in behaviour. Links are now read from the Markdown syntax tree, not by a regex over each line. Three things follow:
[a](x.md "t")) are now checked.The retired-repository rule still scans raw lines, as before. On this checkout, both old and new versions pass. The new version counts 155 files, 1306 relative links and 748 fragments. The old one counted 155, 1297 and 744: the extra 9 links and 4 fragments are titled links that the old regex skipped.
Tests ported
The unit tests of the owned slugger (
githubSlug,headingText,markdownAnchors) are now fixture checkouts run throughcheckLinks. They cover the same cases: slugs, repeated headings, explicit anchors, setext headings and fenced code. New fixture cases cover these rules, which were previously checked only against the live checkout:The
shippedLinkProblem/pinnedRepositoryPathtests are unchanged.test/docs-url.test.tsnow checks core'sdocsUrllinks by running them throughcheckLinksinstead ofmarkdownAnchors.One old case is dropped: the
Safe <scr<b>ipt>headingtag-stripping case. It tested the owned sanitizer, which is removed. The tool slugs from mdast text with HTML excluded.Measure
scripts/check-local-links.ts: 349 → 162 lines (+122 / −309). That is more than the ~80 estimated. The rule logic is about 80 lines; the rest is the engine wiring, the file walk and a 27-line header documenting the rules.test/doc-checks.test.ts+50 / −29;test/docs-url.test.ts+7 / −8.CONTRIBUTING.md: +4 / −1 (names the tool and the residual rules).[email protected],[email protected],[email protected],[email protected].vfileis declared only because the script and tests import it; it adds no lockfile entries.packagesentries added (201 → 367). No existing entry changed or was removed, andpackage-lock.jsongrew by 2,395 lines. Most of the added entries come from unified-engine, which remark-validate-links itself depends on:@npmcli/config,glob,load-plugin, the micromark family and others.Verification
npm run verifypasses locally (lint, both typechecks,check:docs, build, full tests, workspaces).[a](GONE.md)and[b](docs/HTTP.md#nope)reportsdead-relative-linkanddead-fragment.Not done: docs/FRAMEWORK.md "Ownership" is not edited, as instructed.
🤖 Generated with Claude Code