Skip to content

Latest commit

 

History

History
56 lines (39 loc) · 1.31 KB

one-component-per-file.md

File metadata and controls

56 lines (39 loc) · 1.31 KB
pageClass sidebarDepth title description
rule-details
0
vue/one-component-per-file
enforce that each component should be in its own file

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', {
  // ...
})
<script>
/* ✓ GOOD */
export default {
  name: 'my-component'
}
</script>

🔧 Options

Nothing.

📚 Further Reading

🔍 Implementation