Skip to content

Latest commit

 

History

History
82 lines (62 loc) · 2.27 KB

no-reserved-component-names.md

File metadata and controls

82 lines (62 loc) · 2.27 KB
pageClass sidebarDepth title description
rule-details
0
vue/no-reserved-component-names
disallow the use of reserved names in component definitions

vue/no-reserved-component-names

disallow the use of reserved names in component definitions

📖 Rule Details

This rule prevents name collisions between Vue components and standard HTML elements and built-in components.

<script>
/* ✗ BAD */
export default {
  name: 'div'
}
</script>

🔧 Options

{
  "vue/no-reserved-component-names": ["error", {
    "disallowVueBuiltInComponents": false,
    "disallowVue3BuiltInComponents": false
  }]
}
  • disallowVueBuiltInComponents (boolean) ... If true, disallow Vue.js 2.x built-in component names. Default is false.
  • disallowVue3BuiltInComponents (boolean) ... If true, disallow Vue.js 3.x built-in component names. Default is false.

"disallowVueBuiltInComponents": true

<script>
/* ✗ BAD */
export default {
  name: 'transition-group'
}
</script>

"disallowVue3BuiltInComponents": true

<script>
/* ✗ BAD */
export default {
  name: 'teleport'
}
</script>

📚 Further reading

🔍 Implementation