Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
rightaway opened this issue Apr 29, 2019 · 4 comments
Closed

Comments

@rightaway
Copy link

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
Copy link
Member

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

Please use the latest version.

@andre-brdoch
Copy link

andre-brdoch commented Sep 12, 2019

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
Copy link

@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
Copy link
Author

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

wmfgerrit pushed a commit to wikimedia/mediawiki-extensions-Wikibase that referenced this issue Feb 6, 2020
This should fix all medium-and-above severity security issues reported
by npm audit. The only remaining issue that cannot be fixed by running
`npm upgrade` or `npm audit fix` will be fixed in a follow-up commit.

The rule to enforce a single root in vue templates seems to be a bit
overzealous. This has already been reported upstream in
vuejs/eslint-plugin-vue#971 and was also discussed in
vuejs/eslint-plugin-vue#884 and vuejs/eslint-plugin-vue#986 without
obvious solution that would be applicable here. Solved by adding a not
strictly necessary wrapping span.

Change-Id: I3153c0f45ce53704ef2c02d7e2e2e4f6d67e3fc7
wmfgerrit pushed a commit to wikimedia/mediawiki-extensions that referenced this issue Feb 6, 2020
* Update Wikibase from branch 'master'
  to e7ada5fde5f187fef50badd632676363f322691f
  - Merge "bridge: Upgrade dependencies"
  - bridge: Upgrade dependencies
    
    This should fix all medium-and-above severity security issues reported
    by npm audit. The only remaining issue that cannot be fixed by running
    `npm upgrade` or `npm audit fix` will be fixed in a follow-up commit.
    
    The rule to enforce a single root in vue templates seems to be a bit
    overzealous. This has already been reported upstream in
    vuejs/eslint-plugin-vue#971 and was also discussed in
    vuejs/eslint-plugin-vue#884 and vuejs/eslint-plugin-vue#986 without
    obvious solution that would be applicable here. Solved by adding a not
    strictly necessary wrapping span.
    
    Change-Id: I3153c0f45ce53704ef2c02d7e2e2e4f6d67e3fc7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants