# useSvelteStoreInitialValue

Rule `biome/useSvelteStoreInitialValue`. Require Svelte stores to be created with an initial value.

- Source: biome
- Technologies: Svelte
- Kind: style
- Needs type information: no
- Autofix: no
- Reach: 0 weekly downloads of presets that enable it
- Trend: 0% last quarter
- Rank: #1968 by reach

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| Biome | `nursery/useSvelteStoreInitialValue` | no | no | group nursery, since 2.6.5 | [docs](https://biomejs.dev/linter/rules/use-svelte-store-initial-value/) |

## Code examples

### Incorrect: the rule reports this

```js
import { writable } from "svelte/store";

export const count = writable();
```

```js
import { readable } from "svelte/store";

export const time = readable();
```

```js
import { derived } from "svelte/store";
import { count } from "./count.js";

export const delayed = derived(count, ($count, set) => {
    setTimeout(() => set($count), 1000);
});
```

### Correct: the rule accepts this

```js
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.

## Enable it

### Biome: `biome.json`

```json
{
  "linter": {
    "rules": {
      "nursery": {
        "useSvelteStoreInitialValue": "error"
      }
    }
  }
}
```

## Related rules

- [biome/useSolidForComponent](https://lintradar.dev/rules/biome/useSolidForComponent.md): Enforce using Solid's `<For />` component for mapping an array to JSX elements.
- [biome/useTailwindShorthandClasses](https://lintradar.dev/rules/biome/useTailwindShorthandClasses.md): Enforce using fewer Tailwind utilities instead of multiple utilities that are functionally the same.
- [biome/useReactNamingConvention](https://lintradar.dev/rules/biome/useReactNamingConvention.md): Enforces naming conventions for React `createContext`, `useId`, and `useRef`.
- [biome/useTailwindStaticClassStrings](https://lintradar.dev/rules/biome/useTailwindStaticClassStrings.md): Require complete, statically written class names.
- [biome/useReactFunctionComponents](https://lintradar.dev/rules/biome/useReactFunctionComponents.md): Enforce that components are defined as functions and never as classes.
- [biome/useUniqueElementIds](https://lintradar.dev/rules/biome/useUniqueElementIds.md): Disallow static `id` values on elements outside SVG contexts.

---

Web page: https://lintradar.dev/rules/biome/useSvelteStoreInitialValue. Data from npm and the linters' documentation, collected Dec 4, 2026. Site guide for agents: https://lintradar.dev/llms.txt
