docs: replace /config/# hash links with direct page URLs#9599
Merged
sheremet-va merged 3 commits intovitest-dev:mainfrom Feb 7, 2026
Merged
docs: replace /config/# hash links with direct page URLs#9599sheremet-va merged 3 commits intovitest-dev:mainfrom
/config/# hash links with direct page URLs#9599sheremet-va merged 3 commits intovitest-dev:mainfrom
Conversation
✅ Deploy Preview for vitest-dev ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
Hash-based config links like /config/#reporters relied on a client-side router hook to redirect to /config/reporters. This broke when opening links in a new tab (Ctrl+Click) since the hook only runs on client-side navigation, not on fresh page loads — causing hydration mismatches or wrong content (vitest-dev#9593). Applied via one-shot script (node fix-config-links.mjs from repo root): ```js import { readFileSync, writeFileSync } from 'fs' import { execSync } from 'child_process' const mapping = { '#alias': '/config/alias', '#attachmentsdir': '/config/attachmentsdir', '#bail': '/config/bail', '#clearmocks': '/config/clearmocks', '#coverage': '/config/coverage', '#dangerouslyignoreunhandlederrors': '/config/dangerouslyignoreunhandlederrors', '#environment': '/config/environment', '#environmentoptions': '/config/environmentoptions', '#fileparallelism': '/config/fileparallelism', '#fileParallelism': '/config/fileparallelism', '#forcereruntriggers': '/config/forcereruntriggers', '#globals': '/config/globals', '#globalsetup': '/config/globalsetup', '#include': '/config/include', '#includetasklocation': '/config/includetasklocation', '#isolate': '/config/isolate', '#maxconcurrency': '/config/maxconcurrency', '#maxworkers': '/config/maxworkers', '#mockreset': '/config/mockreset', '#name': '/config/name', '#onunhandlederror': '/config/onunhandlederror', '#outputfile': '/config/outputfile', '#passwithnotests': '/config/passwithnotests', '#pool': '/config/pool', '#provide': '/config/provide', '#reporters': '/config/reporters', '#restoremocks': '/config/restoremocks', '#restoreMocks': '/config/restoremocks', '#root': '/config/root', '#snapshotformat': '/config/snapshotformat', '#snapshotserializers': '/config/snapshotserializers', '#teardowntimeout': '/config/teardowntimeout', '#testnamepattern': '/config/testnamepattern', '#testtimeout': '/config/testtimeout', '#typecheck': '/config/typecheck', '#unstubenvs': '/config/unstubenvs', '#unstubglobals': '/config/unstubglobals', '#chaiconfig-truncatethreshold': '/config/chaiconfig#chaiconfig-truncatethreshold', '#coverage-clean': '/config/coverage#coverage-clean', '#coverage-exclude': '/config/coverage#coverage-exclude', '#coverage-experimentalastawareremapping': '/config/coverage#coverage-experimentalastawareremapping', '#coverage-include': '/config/coverage#coverage-include', '#coverage-reporter': '/config/coverage#coverage-reporter', '#deps-moduledirectories': '/config/deps#deps-moduledirectories', '#deps-optimizer-client': '/config/deps#deps-client', '#faketimers-looplimit': '/config/faketimers#faketimers-looplimit', '#sequence-concurrent': '/config/sequence#sequence-concurrent', '#sequence-hooks': '/config/sequence#sequence-hooks', '#sequence-shuffle': '/config/sequence#sequence-shuffle', '#typecheck-enabled': '/config/typecheck#typecheck-enabled', '#typecheck-ignoresourceerrors': '/config/typecheck#typecheck-ignoresourceerrors', '#typecheck-include': '/config/typecheck#typecheck-include', '#browser-api': '/config/browser/api', '#browser-viewport': '/config/browser/viewport', '#grouporder': '/config/sequence#sequence-grouporder', '#test-dir': '/config/dir', '#server-deps': '/config/server#deps', '#server-deps-inline': '/config/server#inline', } const files = execSync('find docs/ -name "*.md" -type f', { encoding: 'utf8' }) .trim().split('\n') let totalReplacements = 0 const unmapped = new Set() for (const file of files) { let content = readFileSync(file, 'utf8') let modified = false const newContent = content.replace(/\/config\/(#[^)#\s]+)/g, (match, hash) => { const replacement = mapping[hash] if (replacement) { totalReplacements++; modified = true; return replacement } unmapped.add(hash) return match }) if (modified) { writeFileSync(file, newContent); console.log('Updated: ' + file) } } console.log('\nTotal replacements: ' + totalReplacements) if (unmapped.size > 0) console.log('Unmapped hashes:', [...unmapped]) ``` Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
22d109c to
37ea852
Compare
4 tasks
sheremet-va
approved these changes
Feb 7, 2026
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.
Description
/config/#...link doesn't show content after opened via new tab #9593I didn't think deeper and asked Claude.
Hash-based config links like /config/#reporters relied on a client-side
router hook to redirect to /config/reporters. This broke when opening
links in a new tab (Ctrl+Click) since the hook only runs on client-side
navigation, not on fresh page loads — causing hydration mismatches or
wrong content (#9593).
Applied via one-shot script (node fix-config-links.mjs from repo root):
Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com
Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
pnpm-lock.yamlunless you introduce a new test example.Tests
pnpm test:ci.Documentation
pnpm run docscommand.Changesets
feat:,fix:,perf:,docs:, orchore:.