Skip to content

vue/require-default-export

require components to be the default export

📖 Rule Details

This rule reports when a Vue component does not have a default export, if the component is not defined as <script setup>.

<!-- ✗ BAD --> <script> const foo = 'foo'; </script>
Now loading...
<!-- ✓ GOOD --> <script> export default { data() { return { foo: 'foo' }; } }; </script>
Now loading...

🔧 Options

Nothing.

🚀 Version

This rule was introduced in eslint-plugin-vue v9.28.0

🔍 Implementation