Closed
Description
Please describe what the rule should do:
Similar to https://eslint.vuejs.org/rules/no-lifecycle-after-await.html and https://eslint.vuejs.org/rules/no-watch-after-await.html but applies to expose
call. Because expose
needs access to the current instance too.
What category should the rule belong to?
[ ] Enforces code style (layout)
[x] 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>
import { defineComponent } from 'vue'
export defineComponent({
setup(props, { expose }) {
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
await sleep(100)
const sayHi = () = alert('hello')
expose({ sayHi })
}
})
</script>
Additional context