Please describe what the rule should do:
Analogous to define-props-declaration, there should be a rule define-model-declaration that enforces a type-based declaration.
What category should the rule belong to?
[x] Enforces code style (layout)
[ ] Warns about a potential error (problem)
[ ] Suggests an alternate way of doing something (suggestion)
[ ] Other (please specify:)
Provide 2-3 code examples that this rule should warn about:
<script setup lang="ts">
defineModel();
</script>
<script setup lang="ts">
defineModel({ type: String });
</script>
Workaround
'no-restricted-syntax': [
'error',
{
message:
'defineModel() must use an explicit type parameter, e.g. defineModel<string>().',
selector:
"CallExpression[callee.name='defineModel']:not([typeArguments]):not([typeParameters])",
},
],
Please describe what the rule should do:
Analogous to define-props-declaration, there should be a rule define-model-declaration that enforces a type-based declaration.
What category should the rule belong to?
[x] Enforces code style (layout)
[ ] Warns about a potential error (problem)
[ ] Suggests an alternate way of doing something (suggestion)
[ ] Other (please specify:)
Provide 2-3 code examples that this rule should warn about:
Workaround