Eslint-plugin-vue: x-invalid-end-tag with iviewui component

Created on 8 Mar 2018  路  9Comments  路  Source: vuejs/eslint-plugin-vue

Tell us about your environment
vue: 2.5.2
iview: 2.9.2

  • ESLint Version:
    babel-eslint: 8.2.1
    eslint: 4.15.0

  • eslint-plugin-vue Version:
    eslint-plugin-vue: 4.0.0

  • Node Version:
    node: 8.9.4

Please show your full configuration:

vs code 1.20.1
Vetur plugin enabled 0.11.7
ESLint plugin enabled 1.4.7

What did you do? Please include the actual source code causing the issue.

screen shot 2018-03-08 at 8 09 58 am

What did you expect to happen?
No eslint error

What actually happened? Please include the actual, raw output from ESLint.
[vue/no-parsing-error] Parsing error: x-invalid-end-tag.

bug upstream issue

Most helpful comment

Solution:

"vue/no-parsing-error": [2, { "x-invalid-end-tag": false }]

see view issue

All 9 comments

It looks like a problem in vue-eslint-parser - Reproduction

It works well if you use kebab-casing, but with UpperCamelCasing it not only has problems with invalid end tag, but results in error regarding root element being text instead of element/component. It's probably an AST related issue that causes these problems.

cc @mysticatea

image

The issue happens on native elements as well. Is there a way of removing this error without messing with eslint config?

@AnikaErceg In the example you provided, I think the plugin is doing its job correctly. HTML <input> tag shouldn't be closed. So the easy way of removing the error is to remove </input>

Solution:

"vue/no-parsing-error": [2, { "x-invalid-end-tag": false }]

see view issue

Hi. I apologize for the delay.

Indeed, this is a bug.
The <menuitem> element was a void element before, but it was removed in https://github.com/whatwg/html/pull/907.
The vue-eslint-parser has to follow the spec change.

I'm surprised that a certain commit can close the issue in other repositories.

@snowshoes
set follow configuration in .eslintrc.js rules

"vue/no-parsing-error": [2, { "x-invalid-end-tag": false }]

can't work
relevant version:

"eslint": "^5.4.0",
"eslint-plugin-vue": "^5.0.0-beta.3",

.eslintrc.js

module.exports = {
  root: true,
  env: {
    node: true
  },
  extends: ['plugin:vue/strongly-recommended', '@vue/prettier'],
  plugins: ['vue', 'prettier'],
  rules: {
    'vue/no-parsing-error': [2, { 'x-invalid-end-tag': false }],
    'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
    'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
    'prettier/prettier': 'error',
    semi: ['error', 'never']
  },
  parserOptions: {
    parser: 'babel-eslint'
  }
}

i need anything else to configure?

image

Was this page helpful?
0 / 5 - 0 ratings

Related issues

armano2 picture armano2  路  4Comments

filipalacerda picture filipalacerda  路  4Comments

xiGUAwanOU picture xiGUAwanOU  路  3Comments

Mouvedia picture Mouvedia  路  3Comments

apertureless picture apertureless  路  4Comments