Skip to content

fix: allow skipping client-side fragment validation - #862

Merged
JustinBeckwith merged 1 commit into
mainfrom
codex/investigate-client-fragments
Jul 23, 2026
Merged

fix: allow skipping client-side fragment validation#862
JustinBeckwith merged 1 commit into
mainfrom
codex/investigate-client-fragments

Conversation

@JustinBeckwith

Copy link
Copy Markdown
Owner

Summary

  • add --skip-fragment / skipFragment for CLI and config users
  • add fragmentsToSkip regex/function support to the API
  • report matching fragment checks as SKIPPED while still checking the fragmentless HTTP URL
  • document the behavior and cover SPA state, hash routers, encoded fragments, strict non-matches, repeated CLI flags, and config loading

Root cause

HTTP requests never send URL fragments to the server. Linkinator can verify traditional fragments against server-rendered HTML, but it cannot infer whether JavaScript will consume a fragment as application state. Treating every missing static identifier as definitely broken creates false positives for links such as TypeScript Playground #code/... URLs.

This change keeps strict fragment validation as the default and adds an explicit, fragment-specific escape hatch. Unlike --skip, it skips only fragment validation; the underlying URL is still requested and must pass.

Validation

  • npm run build
  • npm run lint (passes; existing Biome schema-version informational notice remains)
  • focused CLI/API/config/core tests: 138 passed
  • full suite on current Node: 250 passed
  • full suite on Node 22: 250 passed
  • full suite on Node 26: 250 passed
  • coverage suite: 250 passed; 94.01% statements / 88.9% branches / 97.95% functions / 93.95% lines
  • npm pack --dry-run
  • real tarball install plus installed CLI version/fragment checks
  • all standalone binaries built; macOS binary version/fragment checks passed
  • npm run docs-test: 17 live README links passed
  • live issue reproduction on TypeScript docs:
    • strict mode: 15 fragment failures
    • skipping ^code/ and ^show-examples$: only unrelated GitHub #readme remained strict/broken
    • adding explicit ^readme$: 0 broken; client-state fragments skipped; TypeScript Playground and GitHub base URLs independently remained HTTP-OK

Closes #858

@JustinBeckwith
JustinBeckwith marked this pull request as ready for review July 23, 2026 22:18
@JustinBeckwith
JustinBeckwith force-pushed the codex/investigate-client-fragments branch from e989020 to c5deca0 Compare July 23, 2026 22:19
@JustinBeckwith
JustinBeckwith force-pushed the codex/investigate-client-fragments branch from c5deca0 to ff2cce4 Compare July 23, 2026 22:21
@JustinBeckwith
JustinBeckwith merged commit 1b28af6 into main Jul 23, 2026
8 checks passed
@JustinBeckwith
JustinBeckwith deleted the codex/investigate-client-fragments branch July 23, 2026 22:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fragment validation reports client-side URL state as missing DOM fragments

1 participant