Note

This is a documentation for version 7.0.0-alpha.5.
To check version 6.2.2 go here. To check previous releases go here.

# vue/one-component-per-file

enforce that each component should be in its own file

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

# 📖 Rule Details

This rule checks if there is only one component per file.

/* ✗ BAD */ Vue.component('TodoList', { // ... }) Vue.component('TodoItem', { // ... })
Now loading...
<script> /* ✓ GOOD */ export default { name: 'my-component' } </script>
Now loading...

# 🔧 Options

Nothing.

# 📚 Further reading

# 🔍 Implementation