vetur: Self-closing tags error

  • Platform: Mac OS X El Capitan 10.11.6
  • Vetur version: 0.8.2
  • VSCode version: 1.13.1

Error: Self-Closing Tags

While self-closing tags are not valid for in-dom templates, the vue-loader that parses .vue files into render functions can handle self-closing tags in v2. See this comment in the vue issues: https://github.com/vuejs/vue/issues/1036#issuecomment-266756591

Expected

I think a nice aesthetic around this environment specific error is to make it a configuration option. Another option would be to ignore this error in .vue files.

image image

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 2
  • Comments: 19 (17 by maintainers)

Commits related to this issue

Most upvoted comments

Took me a few tries to figure out how to write the rule, so for posterity, this worked for me:

{
    "plugins": [
        "vue"
    ],
    "rules": {
        "vue/html-no-self-closing": 0
    }
}

We are incorporating https://github.com/vuejs/eslint-plugin-vue now and this comes from its rule:

https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/html-no-self-closing.md

So create a .eslintrc to disable it. I’ll add vetur.validation.template in the next version to disable html validation totally.

Upgrade to 0.8.3 and set "vetur.validation.template": false in VSCode setting.