vuejs / eslint-plugin-vue

Official ESLint plugin for Vue.js
https://eslint.vuejs.org/
MIT License
4.45k stars 667 forks source link

valid-template-root should allow multiple tags if part of same v-if #884

Closed rightaway closed 5 years ago

rightaway commented 5 years ago

valid-template-root gives an error if you have the following but it is allowed by Vue so this shouldn't give an error. Same applies if you have 1 or more v-else-if elements there.


<template>
  <div v-if=condition>if</div>
  <div v-else>else</div>
</template>
mysticatea commented 5 years ago

Thank you for this issue, but I could not reproduce it: online demo

Please use the latest version.

andre-brdoch commented 5 years ago

i have the same issue as @rightaway

"eslint": "<6.0.0",
"eslint-loader": "^3.0.0",
"eslint-plugin-vue": "^5.2.3",
"eslint-plugin-vue-a11y": "0.0.31"

edit: the same code that triggers an error in my editor, works just fine with the vue-eslint-demo

jbmoelker commented 5 years ago

@andre-brdoch I experienced the same issue. However when I removed eslint-plugin-vue-a11y from my setup, eslint-plugin-vue was no longer throwing the valid-template-root error. 🤷‍♂ So seems to be an issue of either eslint-plugin-vue-a11y or the combination of the two.

rightaway commented 4 years ago

@andre-brdoch What do you think the issue is if it works in the demo but not in your editor?