enforce valid template root

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

This rule checks whether every template root is valid.

📖 Rule Details

This rule reports the template root in the following cases:

<!-- There is no root element --> <template></template>
Now loading...
<!-- The root is text --> <template>Lorem ipsum</template>
Now loading...
<!-- There are multiple root elements --> <template> <div>hello</div> <div>hello</div> </template>
Now loading...
<!-- The root element has `v-for` directives --> <template> <div v-for="item in items"/> </template>
Now loading...
<!-- The root element is `<template>` or `<slot>` --> <template> <slot /> </template>
Now loading...

🔧 Options


🔍 Implementation

Last Updated: 12/30/2018, 3:44:02 AM