nursery/useSvelteStoreInitialValue
nursery · since 2.6.5
{
"linter": {
"rules": {
"nursery": {
"useSvelteStoreInitialValue": "error"
}
}
}
}Require Svelte stores to be created with an initial value.
import { writable } from "svelte/store";
export const count = writable();import { readable } from "svelte/store";
export const time = readable();import { derived } from "svelte/store";
import { count } from "./count.js";
export const delayed = derived(count, ($count, set) => {
setTimeout(() => set($count), 1000);
});import { derived, readable, writable } from "svelte/store";
export const count = writable(0);
export const time = readable(new Date());
export const delayed = derived(
count,
($count, set) => {
setTimeout(() => set($count), 1000);
},
0,
);Examples from the Biome documentation.
No tracked preset enables this rule, so it has no reach yet.
None of the tracked presets enable this rule. Turn it on with the config below.
ESLint does not have this rule.
Oxlint does not have this rule.
nursery/useSvelteStoreInitialValue
nursery · since 2.6.5
{
"linter": {
"rules": {
"nursery": {
"useSvelteStoreInitialValue": "error"
}
}
}
}Enforce using Solid's <For /> component for mapping an array to JSX elements.
Enforce using fewer Tailwind utilities instead of multiple utilities that are functionally the same.
Enforces naming conventions for React createContext, useId, and useRef.
Require complete, statically written class names.
Enforce that components are defined as functions and never as classes.
Disallow static id values on elements outside SVG contexts.