no-navigation-without-resolve false positive with Paraglide localizeHref (scaffolded by sv create)

#1492

Development PRs

Issue

needs repro
Opened at Mar 9, 2026, 11:02 AM
P
playday3008
Mar 9, 2026, 11:02 AM

Before You File a Bug Report Please Confirm You Have Done The Following...

  • I have tried restarting my IDE and the issue persists.
  • I have updated to the latest version of the packages.

What version of ESLint are you using?

10.0.3

What version of eslint-plugin-svelte are you using?

3.15.1

What did you do?

// eslint.config.js
import prettier from 'eslint-config-prettier';
import path from 'node:path';
import { includeIgnoreFile } from '@eslint/compat';
import js from '@eslint/js';
import svelte from 'eslint-plugin-svelte';
import { defineConfig } from 'eslint/config';
import globals from 'globals';
import ts from 'typescript-eslint';
import svelteConfig from './svelte.config.js';

const gitignorePath = path.resolve(import.meta.dirname, '.gitignore');

export default defineConfig(
      includeIgnoreFile(gitignorePath),
      js.configs.recommended,
      ...ts.configs.recommended,
      ...svelte.configs.recommended,
      prettier,
      ...svelte.configs.prettier,
      {
              languageOptions: { globals: { ...globals.browser, ...globals.node } },
              rules: {
                      'no-undef': 'off'
              }
      },
      {
              files: ['**/*.svelte', '**/*.svelte.ts', '**/*.svelte.js'],
              languageOptions: {
                      parserOptions: {
                              projectService: true,
                              extraFileExtensions: ['.svelte'],
                              parser: ts.parser,
                              svelteConfig
                      }
              }
      }
);
<!-- src/routes/+layout.svelte (generated by sv create) -->
<script lang="ts">
      import { page } from '$app/state';
      import { locales, localizeHref } from '$lib/paraglide/runtime';
      import './layout.css';
      import favicon from '$lib/assets/favicon.svg';

      let { children } = $props();
</script>

<svelte:head><link rel="icon" href={favicon} /></svelte:head>
{@render children()}

<div style="display:none">
      {#each locales as locale} <!-- <-- also missing `(locale)` here, but that's manually very easy fixable -->
              <a href={localizeHref(page.url.pathname, { locale })}>{locale}</a>
      {/each}
</div>

What did you expect to happen?

localizeHref() from @inlang/paraglide-js should be recognized as a valid navigation helper (like resolve()), or the scaffolded template should use a pattern that satisfies the rule. This is the default code generated by sv create with the Paraglide addon — it errors out of the box with no user modifications.

What actually happened?

/src/routes/+layout.svelte
  15:6  error  Unexpected href link without resolve()  svelte/no-navigation-without-resolve

Wrapping with resolve() from $app/paths causes a TypeScript error because localizeHref() returns string, not the expected "/" | `/${string}/` type

Link to GitHub Repo with Minimal Reproducible Example

bun x [email protected] create --template minimal --types ts --add prettier eslint vitest="usages:unit,component" playwright tailwindcss="plugins:typography,forms" sveltekit-adapter="adapter:auto" devtools-json paraglide="languageTags:en, es+demo:no" mcp="ide:other+setup:remote" --install bun .

Additional comments

No response

👍 4