feat(no-navigation-without-resolve): skip unknown URLs by default and add strict mode

#1651

Closing issues

Pull request

Opened at Nov 3, 2026, 5:21 PM
B
baseballyama
Nov 3, 2026, 5:21 PM

Rebuilds svelte/no-navigation-without-resolve to check statically identifiable URL patterns while skipping unknown values by default. The new strict option also reports values the analysis cannot verify.

This is a base-path navigation policy check, not proof that a URL is broken: the rule does not know the deployment origin or routing configuration.

Docs: no-navigation-without-resolve.md

Behavior

  • Check links, <area>, SVG <a>, form actions and submit-control formaction, plus goto(), pushState(), replaceState(), preloadData() and preloadCode().
  • Accept query/hash-only destinations, empty URLs, page.url, query/hash suffixes after resolve(), and nullable ResolvedPathname values in URL-taking sinks. Relative URLs usually keep the base path, so they are reported only with strict (or allowRelativePaths: false).
  • Respect form ownership (including explicit form attributes), submit-control types and effective formmethod; skip non-submitting controls and dialog submissions. The rel="external" exemption for links/forms expresses lint policy; it does not guarantee that SvelteKit routing or use:enhance is bypassed.
  • HTTP(S) and protocol-relative URLs in navigation calls may be same-origin: skip them by default and report them as unverifiable with strict. Report non-HTTP(S) URLs in these calls.
  • Check only the supported first preloadCode() argument: a root-relative pathname on Kit 2, a route ID on Kit 3. The pathname requirement is not relaxed by allowRelativePaths.
  • Follow variables, reassignments, $state(), $derived(), $props() defaults, arrays, objects, {#each} and declared TypeScript literal types. Bound recursive evaluation, handle empty-string fallbacks and null/undefined defaults, and verify bindings before treating calls as read-only.
  • Provide targeted diagnostics and resolve() / asset() suggestions. Run only on SvelteKit 2.26+; deprecate ignoreGoto, ignoreLinks, ignorePushState and ignoreReplaceState.

The rule documentation describes accepted patterns, strict-mode behavior and analysis limitations. One minor changeset covers the change.

Specification checks

Rechecked SvelteKit's , and , together with the Kit 2.26 implementation for version-specific behavior.

Validation

  • Full plugin test suite: 1,710 passing. TypeScript, ESLint and formatting checks pass.

Real-project check

I ran the final rule (31948b7c) on 55 popular SvelteKit repositories, without type information. Each project used SvelteKit 2.70.3 or 3.1.1, matching its declared major version (pluja/whishper uses SvelteKit 1, so the rule does not run there).

  • Default mode: 1,698 reports. All are root-relative paths such as href="/about" or goto('/login'). 1,674 have the path written on the reported line, and I checked all 24 others by hand: they hold literal paths like `/trail/view/${id}`. The only false positive found (base || '/' in huggingface/chat-ui) is fixed in this PR.
  • Existing eslint-disable comments: these repositories have 155 comments that disable this rule. 152 of those lines are no longer reported. The other 3 are root-relative paths. One of them is a link to a backend API, and the message suggests rel="external" for that case.
  • Current rule (main, 8c8a881e): 3,151 reports on the same repositories, with the same setup.
  • Strict mode: 3,034 reports. The extra reports are unknown values (by design) and links with spread attributes.
  • Not app code: most reports in sveltejs/kit (test apps) and sveltejs/svelte.dev (tutorial apps) come from code that is not linted in practice.
  • Private app: I also ran the rule with type information on a large private SvelteKit monorepo (5 apps). Default mode gives 30 reports, all root-relative literals. The current rule gives 205 reports there, and at least 107 of them are false positives.
  • No crashes.
Repositories
Repository Stars main This PR (default) This PR (strict)
open-webui/open-webui 157,976 267 220 264
immich-app/immich 118,425 168 7 163
sveltejs/kit 20,903 353 335 351
VERT-sh/VERT 16,221 2 0 2
huggingface/chat-ui 11,024 58 1 27
huntabyte/shadcn-svelte 9,246 79 14 91
getarcaneapp/arcane 8,210 32 4 28
seriousm4x/UpSnap 6,417 2 0 2
pheralb/svgl 6,410 9 3 6
skeletonlabs/skeleton 6,088 42 23 41
rajnandan1/kener 5,238 55 1 56
EpicenterHQ/epicenter 4,840 12 0 12
open-wanderer/wanderer 4,057 77 62 76
seanmorley15/AdventureLog 3,863 142 88 135
huntabyte/bits-ui 3,653 15 6 15
strelov1/freehire 3,414 136 2 90
pluja/whishper 3,103 2 0 0
rilldata/rill 2,985 161 40 159
undb-io/undb 2,974 70 66 73
ciscoheat/sveltekit-superforms 2,784 81 79 83
Dictionarry-Hub/profilarr 2,769 75 44 94
gurucomputing/headscale-ui 2,738 9 0 0
sveltejs/realworld 2,421 29 30 31
immichFrame/ImmichFrame 2,418 1 0 0
scosman/CMSaasStarter 2,371 45 43 46
svecosystem/runed 1,863 4 0 0
itswadesh/svelte-commerce 1,826 198 132 198
classroomio/classroomio 1,736 292 80 280
sbondCo/Watcharr 1,593 3 1 2
sftwrdotdev/Markpad 1,378 0 0 0
binimum/tidal-ui 1,340 25 24 25
kunkunsh/kunkun 1,309 53 1 50
syntaxfm/website 1,216 90 77 91
vnphanquang/svelte-put 1,043 19 6 16
meursyphus/ssgoi 1,016 13 10 13
HoudiniGraphql/houdini 983 10 5 10
getopenpost/openpost 884 212 43 199
slatinsky/DiscordChatExporter-frontend 836 0 0 0
TrenTorch/TrenTorch 819 8 0 4
svecosystem/formsnap 806 0 0 0
opral/paraglide-js 799 0 0 0
filipsobol/sonda 789 0 0 0
mawoka-myblock/ClassQuiz 737 54 52 54
oekazuma/svelte-meta-tags 685 0 0 0
Tsuzat/Edra 683 3 0 3
artiebits/svelte-seo 564 0 0 0
joshnuss/svelte-stripe 493 21 21 21
sveltejs/svelte.dev 335 172 147 173
kampsy/ui 289 36 27 36
janosh/svelte-bricks 146 4 0 4
furudean/type-kana 134 8 4 7
K-Sato1995/svelte-vertical-timeline 129 0 0 0
metonym/sveltekit-gh-pages 112 1 0 0
eas4ai/suprnova 102 0 0 0
ariefsn/svelte-use 100 3 0 3
Total 3,151 1,698 3,034

Issues

Fixes , fixes , fixes , fixes , fixes , fixes , fixes , fixes

  • : by design, unknown data.path is reported only with strict; declared literal types can make a value statically identifiable.
  • (redirect()): not included. Waiting for .
  • Not covered: (<link>), (custom resolve functions; unknown results are skipped in default mode).