Skip to content

Latest commit

 

History

History
72 lines (50 loc) · 1.73 KB

no-expose-after-await.md

File metadata and controls

72 lines (50 loc) · 1.73 KB
pageClass sidebarDepth title description since
rule-details
0
vue/no-expose-after-await
disallow asynchronously registered `expose`
v8.1.0

vue/no-expose-after-await

disallow asynchronously registered expose

  • ⚙️ This rule is included in all of "plugin:vue/vue3-essential", "plugin:vue/vue3-strongly-recommended" and "plugin:vue/vue3-recommended".

📖 Rule Details

This rule reports usages of expose() and defineExpose() after an await expression.
In the setup() function, expose() should be registered synchronously.
In the <script setup>, defineExpose() should be registered synchronously.

<script>
export default {
  async setup(props, { expose }) {
    /* ✓ GOOD */
    expose({/* ... */})

    await doSomething()

    /* ✗ BAD */
    expose({/* ... */})
  }
}
</script>
<script setup>
/* ✓ GOOD */
defineExpose({/* ... */})

await doSomething()

/* ✗ BAD */
defineExpose({/* ... */})
</script>

🔧 Options

Nothing.

📚 Further Reading

🚀 Version

This rule was introduced in eslint-plugin-vue v8.1.0

🔍 Implementation