Skip to content

vue/no-multiple-template-root

disallow adding multiple root nodes to the template

  • ⚙️ This rule is included in the following preset configs:
    • *.configs["flat/vue2-essential"]
    • *.configs["flat/vue2-strongly-recommended"]
    • *.configs["flat/vue2-recommended"]
    • "plugin:vue/vue2-essential"
    • "plugin:vue/vue2-strongly-recommended"
    • "plugin:vue/vue2-recommended"

📖 Rule Details

This rule checks whether template contains single root element valid for Vue 2.

Now loading...
Now loading...
Now loading...
Now loading...

🔧 Options

json
{
  "vue/no-multiple-template-root": ["error", {
    "disallowComments": false
  }]
}
  • "disallowComments" (boolean) Enables there should not be any comments in the template root. Default is false.

"disallowComments": true

Now loading...

🚀 Version

This rule was introduced in eslint-plugin-vue v7.0.0

🔍 Implementation