Skip to content

Adding some flexibility on svelte/no-navigation-without-resolve #1352

@jycouet

Description

@jycouet

Description

As the author of vite-plugin-kit-routes, I would like to make use of this rule to ease the transfert from vite-plugin-kit-routes to native svelteKit when all features will be there.

Native SvelteKit way

<script lang="ts">
	import { resolve } from '$app/paths';
</script>

<a href={resolve('/about')}>About</a>

vite-plugin-kit-routes way

<script lang="ts">
	import { route } from '$lib/ROUTES';
</script>

<a href={route('/about')}>About</a>

What about having in the configuration:

  importKey: 'resolve',
  fromKey: '$app/paths'

It could probably help with localizeHref issues as well (saw it on #1314)

What do you think ?
If you link the idea, I can probably give a try to implement.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions