vue/prefer-define-options
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.
📖 Rule Details
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.
1
2
3
4
5
<script setup>
/* ✓ GOOD */
defineOptions({ name: 'Foo' })
</script>
1
2
3
4
5
6
7
8
<script>
/* ✗ BAD */
export default { name: 'Foo' }
</script>
<script setup>
/* ... */
</script>
🔧 Options
Nothing.
📚 Further Reading
🚀 Version
This rule was introduced in eslint-plugin-vue v9.13.0