pageClass | sidebarDepth | title | description | since |
---|---|---|---|---|
rule-details |
0 |
vue/prefer-define-options |
enforce use of `defineOptions` instead of default export |
v9.13.0 |
enforce use of
defineOptions
instead of default export
- 🔧 The
--fix
option on the command line can automatically fix some of the problems reported by this rule.
This rule aims to enforce use of defineOptions
instead of default export in <script setup>
.
The defineOptions()
macro was officially introduced in Vue 3.3.
<script setup>
/* ✓ GOOD */
defineOptions({ name: 'Foo' })
</script>
<script>
/* ✗ BAD */
export default { name: 'Foo' }
</script>
<script setup>
/* ... */
</script>
Nothing.
This rule was introduced in eslint-plugin-vue v9.13.0