nursery/useSvelteKitResolve
nursery · since 2.6.0
No autofixRecommended
biome.json
{
"linter": {
"rules": {
"nursery": {
"useSvelteKitResolve": "error"
}
}
}
}Require internal navigation in SvelteKit apps to use paths built with resolve().
import { goto } from "$app/navigation";
goto("/foo");import { goto } from "$app/navigation";
import { resolve } from "$app/paths";
goto(resolve("/foo") + "/bar");import { pushState } from "$app/navigation";
pushState("/foo", {});import { goto, pushState, replaceState } from "$app/navigation";
import { resolve } from "$app/paths";
goto(resolve("/foo"));
pushState(resolve("/foo"), {});
replaceState(resolve("/foo"), {});
// Shallow routing
pushState("", {});
replaceState("", {});import { goto } from "$app/navigation";
import type { ResolvedPathname } from "$app/types";
function navigate(path: ResolvedPathname) {
goto(path);
}Examples from the Biome documentation.
ESLint does not have this rule.
Oxlint does not have this rule.
nursery/useSvelteKitResolve
nursery · since 2.6.0
{
"linter": {
"rules": {
"nursery": {
"useSvelteKitResolve": "error"
}
}
}
}Require createEventDispatcher calls to declare the types of their events.
Require importing SvelteKit's app state from $app/state instead of $app/stores.
Disallow number literal object member names which are not base 10 or use underscore as separator.
Require the reactive classes from svelte/reactivity instead of built-in objects that are modified.
Require PlatformColor() and DynamicColorIOS() calls to use values written directly in the call.
Require keyed {#each} blocks in Svelte templates.