Closed thacoon closed 1 year ago
When using TypeScript I get an unresolved variable error in WebStorm
To reproduce this issue, see the following code:
src/routes/test.svelte
<script lang="ts"> import { count } from '../../store/test'; $count.count // here the unresolved variable error is displayed </script> <h1>The count is {$count.count}</h1> <button on:click={count.increment}>+</button> <button on:click={count.decrement}>-</button> <button on:click={count.reset}>reset</button>
store/test.ts
import { writable } from 'svelte/store'; interface Data { count: number } function createCount() { const { subscribe, set, update } = writable<Data>({ count: 0 }); return { subscribe, increment: () => update(n => ({ count: n.count + 1, })), decrement: () => update(n => ({ count: n.count - 1, })), reset: () => set({count: 0}) }; } export const count = createCount();
Related to #303
Contained in WEB-58397 use the svelte language server.
When using TypeScript I get an unresolved variable error in WebStorm
To reproduce this issue, see the following code:
src/routes/test.svelte
store/test.ts