Skip to content

Latest commit

 

History

History
61 lines (41 loc) · 1.51 KB

prefer-define-options.md

File metadata and controls

61 lines (41 loc) · 1.51 KB
pageClass sidebarDepth title description since
rule-details
0
vue/prefer-define-options
enforce use of `defineOptions` instead of default export
v9.13.0

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.

<script setup>
/* ✓ GOOD */
defineOptions({ name: 'Foo' })
</script>
<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

🔍 Implementation