From 2ae719cfc71b720cf6e61f55ed82a0c1e17dc4e3 Mon Sep 17 00:00:00 2001 From: J / Jacob Babich Date: Mon, 5 Sep 2022 13:51:26 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=84=20docs:=20#22?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- projects/svelte-localstorage/README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/projects/svelte-localstorage/README.md b/projects/svelte-localstorage/README.md index 8029866..f4a061b 100644 --- a/projects/svelte-localstorage/README.md +++ b/projects/svelte-localstorage/README.md @@ -7,6 +7,20 @@ This library for Svelte provides writable stores that automatically synchronize npm install --save-dev @babichjacob/svelte-localstorage ``` +### ⌨️ TypeScript +This package uses JSDoc for types and documentation, so an extra step is needed to use it in TypeScript projects [for now](https://github.com/babichjacob/svelte-localstorage/issues/22). Configure your `tsconfig.json` so that it has `compilerOptions.maxNodeModuleJsDepth` set to at least 1: +```json +// tsconfig.json +{ + // When using SvelteKit: "extends": "./.svelte-kit/tsconfig.json", + "compilerOptions": { + // Other options... + "maxNodeModuleJsDepth": 1 + } +} +``` + + ## 🧰 SvelteKit Because this package relies on SvelteKit's generated code, you have to prevent Vite from bundling it in advance ([which results in a build error](https://github.com/babichjacob/svelte-localstorage/issues/18)): ```js