Pattern: Use of async
/await
inside svelte store
Issue: -
This rule reports all uses of async/await inside svelte stores. It causes issues with the auto-unsubscribing features.
/* eslint svelte/no-store-async: "error" */
import { writable, readable, derived } from 'svelte/store';
/* ✓ GOOD */
const w1 = writable(false, () => {});
const r1 = readable(false, () => {});
const d1 = derived(a1, ($a1) => {});
/* ✗ BAD */
const w2 = writable(false, async () => {});
const r2 = readable(false, async () => {});
const d2 = derived(a1, async ($a1) => {});
Nothing.
This rule was introduced in eslint-plugin-svelte v2.7.0