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
Prefer use $emit, $slots, etc in <template> instead of variables defined in <script>.
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:
<!-- Bad --><scriptsetup>constemit=defineEmits('foo')</script>
<template>
<button @click="emit('foo')">Foo</button>
</template>
<!-- Good --><scriptsetup>constemit=defineEmits('foo')</script>
<template>
<button @click="$emit('foo')">Foo</button>
</template>
Thank you for proposing the rule. That rule sounds good to me.
But some users may prefer the opposite style. I think it would be better if it was an option.
What do you think?
Please describe what the rule should do:
Prefer use
$emit
,$slots
, etc in<template>
instead of variables defined in<script>
.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:
Additional context
It can also apply to other properties and methods
The text was updated successfully, but these errors were encountered: