]> git.ipfire.org Git - thirdparty/vuejs/pinia.git/commitdiff
docs: note about strict in TS
authorwildwind123 <34130873+wildwind123@users.noreply.github.com>
Mon, 22 Aug 2022 08:23:15 +0000 (17:23 +0900)
committerGitHub <noreply@github.com>
Mon, 22 Aug 2022 08:23:15 +0000 (10:23 +0200)
Co-authored-by: Eduardo San Martin Morote <posva@users.noreply.github.com>
packages/docs/core-concepts/state.md

index dcd07b20f0f566166e222b1fd79cdc12ef998cb1..0531affb739408e04fa29c3fe845d02c94fff302 100644 (file)
@@ -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', {