From 7aad980ad85a21defb37d718e281b28df9e6e03e Mon Sep 17 00:00:00 2001 From: wildwind123 <34130873+wildwind123@users.noreply.github.com> Date: Mon, 22 Aug 2022 17:23:15 +0900 Subject: [PATCH] docs: note about strict in TS Co-authored-by: Eduardo San Martin Morote --- packages/docs/core-concepts/state.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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', { -- 2.47.2