Skip to content

Fix Paraglide locale links to use resolve#990

Open
samuelstroschein wants to merge 2 commits intosveltejs:mainfrom
samuelstroschein:codex/fix-paraglide-resolve-links
Open

Fix Paraglide locale links to use resolve#990
samuelstroschein wants to merge 2 commits intosveltejs:mainfrom
samuelstroschein:codex/fix-paraglide-resolve-links

Conversation

@samuelstroschein
Copy link
Contributor

@samuelstroschein samuelstroschein commented Mar 17, 2026

Closes opral/paraglide-js#638

Summary

  • import resolve from $app/paths in the Paraglide addon-generated +layout.svelte
  • wrap generated locale switcher hrefs with resolve(localizeHref(...))
  • update the corresponding snapshot

Why

The current generated locale switcher uses raw href={localizeHref(...)} links, which triggers the Svelte ESLint rule svelte/no-navigation-without-resolve in fresh Paraglide-enabled SvelteKit projects.

Verification

  • reproduced the lint failure in bennajah/svelte-demo
  • confirmed changing the link to resolve(localizeHref(...)) fixes the lint error
  • updated the snapshot to match the generated output

@changeset-bot
Copy link

changeset-bot bot commented Mar 17, 2026

🦋 Changeset detected

Latest commit: c157e9b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
sv Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@pkg-pr-new
Copy link

pkg-pr-new bot commented Mar 17, 2026

Open in StackBlitz

npx https://pkg.pr.new/svelte-migrate@990
npx https://pkg.pr.new/sv@990
npx https://pkg.pr.new/@sveltejs/sv-utils@990

commit: c157e9b

@sacrosanctic
Copy link
Contributor

the fix is also here

@manuel3108
Copy link
Member

CI does not seem to be entirely happy yet, not too sure why yet.
Also there seems to be a comment opral/paraglide-js#638 (comment) here questioning if this fixe actually fixes anything.

But we will have to check this at a later point in time

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.

Unexpected href link without resolve().

3 participants