We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
$state
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is there a rule that enforces the declaration of the types for $state? If not, is it worth doing?
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.
<script> // BAD let title: string | undefined = $state(); let data: { value?: number } = $state({}) // GOOD let title = $state<string | undefined>(); let data = $state<{ value?: number }>({}); // UNCHANGED let label = $state(0) </script>
No response
The text was updated successfully, but these errors were encountered:
No branches or pull requests
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: