Skip to content
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

x-invalid-end-tag with iviewui component #423

Closed
edjayks opened this issue Mar 8, 2018 · 9 comments · Fixed by #532
Closed

x-invalid-end-tag with iviewui component #423

edjayks opened this issue Mar 8, 2018 · 9 comments · Fixed by #532
Assignees

Comments

@edjayks
Copy link

edjayks commented Mar 8, 2018

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.

@michalsnik
Copy link
Member

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

@4nik4
Copy link

4nik4 commented Jun 20, 2018

image

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

@agriffis
Copy link

@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>

@snowshoes
Copy link

Solution:

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

see view issue

@mysticatea
Copy link
Member

Hi. I apologize for the delay.

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

@mysticatea
Copy link
Member

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

@yzStrive
Copy link

yzStrive commented Sep 5, 2018

@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?

@yzStrive
Copy link

yzStrive commented Sep 5, 2018

image

@yzStrive
Copy link

iview/iview#2828 (comment) can work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants