no-navigation-without-resolve: error message should explain when to use rel="external"

#1615

Development PR

Issue

T
teemingc
Oct 29, 2026, 5:12 PM

Description

Unexpected href link without resolve(). tells users to wrap the href in resolve() but that's not right for paths outside the SvelteKit app. A clearer error message would explain that same-origin links such as /admin, which are not part of the SvelteKit app, should be marked as external. This is currently only mentioned in the docs, so folks may get confused seeing this error message.

Proposal

  1. linkWithoutResolve: Links to routes in this app should use resolve() from '$app/paths'. If the link points outside this app (another site, or a path served by a different app), add rel="external".
  2. gotoWithoutResolve / pushStateWithoutResolve / replaceStateWithoutResolve: Navigation to routes in this app should use resolve() from '$app/paths'. To navigate outside this app, use window.location.
  3. (Optional, TS only) When the href is a string literal that doesn't match any route in $app/types, report a dedicated message, e.g. '/admin' is not a route in this app. If it belongs to another app, add rel="external"; otherwise check for a typo.

Related: