You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
IMO, Rich's reasoning with inference doesn't apply to $state because unlike $props, the initializer value is a parameter and therefore TS will error out if it's incorrect.
However, IMHO, it's better to be consistent between $state and $props - so my preference would actually be a rule that does the exact opposite from the original proposal :D
Motivation
Is there a rule that enforces the declaration of the types for
$state
? If not, is it worth doing?Description
For consistency, we could have a rule similar to prefer-reduce-type-parameter, that clearly enforces where to define the type of a
$state
variable.Examples
Additional comments
No response
The text was updated successfully, but these errors were encountered: