no-navigation-without-resolve: goto('', { shallow: true }) is reported, but pushState('') / replaceState('') are allowed

#1609

Development PRs

Issue

J
jose-manuel-silva
Oct 15, 2026, 11:01 PM

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?

9.39.5

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

3.23.1

What did you do?

Configuration
import svelte from 'eslint-plugin-svelte';

export default [
	...svelte.configs.recommended,
	{
		files: ['**/*.svelte'],
		rules: { 'svelte/no-navigation-without-resolve': 'error' }
	}
];
<script>
	import { goto, pushState, replaceState } from '$app/navigation';

	pushState('', {});
	replaceState('', {});
	goto('', { shallow: true, state: {} });
	goto('', { shallow: true, replace: true, state: {} });
</script>

SvelteKit 3 deprecates pushState / replaceState in favour of goto(url, { state, shallow: true }) / goto(url, { state, shallow: true, replace: true }) (see the @deprecated notes in @sveltejs/kit/types/index.d.ts). The rule accepts an empty URL for pushState('') / replaceState(''), which the rule docs list as valid shallow routing, but reports the same call written the way Kit 3 recommends.

What did you expect to happen?

No errors: the two goto calls are the Kit 3 replacements for the pushState / replaceState calls above them, which the rule already accepts.

What actually happened?

src/Repro.svelte
  6:7  error  Unexpected goto() call without resolve()  svelte/no-navigation-without-resolve
  7:7  error  Unexpected goto() call without resolve()  svelte/no-navigation-without-resolve

✖ 2 problems (2 errors, 0 warnings)

Link to GitHub Repo with Minimal Reproducible Example

https://github.com/jose-manuel-silva/repro-eslint-goto-shallow

Additional comments

In the source, checkGotoCall passes {} to isValueAllowed while checkShallowNavigationCall passes { allowEmpty: true }, and goto's options argument is never read. Same on main (90d7b09). Draft keeps allowEmpty limited to pushState / replaceState, so it doesn't change this. A possible fix: pass { allowEmpty: true } in checkGotoCall when the second argument is an object literal with shallow: true (or allow '' for goto in general, since it resolves to the current URL). @sveltejs/kit 3.1.0, svelte 5.57.2. Related: .