From: wildwind123 <34130873+wildwind123@users.noreply.github.com> Date: Mon, 22 Aug 2022 08:23:15 +0000 (+0900) Subject: docs: note about strict in TS X-Git-Tag: pinia@2.0.21~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7aad980ad85a21defb37d718e281b28df9e6e03e;p=thirdparty%2Fvuejs%2Fpinia.git docs: note about strict in TS Co-authored-by: Eduardo San Martin Morote --- diff --git a/packages/docs/core-concepts/state.md b/packages/docs/core-concepts/state.md index dcd07b20..0531affb 100644 --- a/packages/docs/core-concepts/state.md +++ b/packages/docs/core-concepts/state.md @@ -29,7 +29,7 @@ If you are using Vue 2, the data you create in `state` follows the same rules as ## TypeScript -You don't need to do much in order to make your state compatible with TS. Pinia will infer the type of your state automatically but there are a few cases where you should give it a hand with some casting: +You don't need to do much in order to make your state compatible with TS: make sure [`strict`](https://www.typescriptlang.org/tsconfig#strict), or at the very least, [`noImplicitThis`](https://www.typescriptlang.org/tsconfig#noImplicitThis), are enabled and Pinia will infer the type of your state automatically! However, there are a few cases where you should give it a hand with some casting: ```ts const useStore = defineStore('storeId', {