Skip to content

html-self-closing with --fix doesn't normalise whitespace in opening tag #199

Closed
@axelboc

Description

@axelboc
  • ESLint version: 4.8.0
  • eslint-plugin-vue version: 3.13.0
  • Node version: 6.11.3
{
  "extends": [
    "eslint-config-airbnb",
    "plugin:vue/recommended"
  ],
  "rules": {
    "vue/attribute-hyphenation": "error",
    "vue/html-quotes": "error",
    "vue/html-self-closing": "error",
    "vue/mustache-interpolation-spacing": "error",
    "vue/no-dupe-keys": "error",
    "vue/no-duplicate-attributes": "error",
    "vue/no-multi-spaces": "error",
    "vue/no-reserved-keys": "error",
    "vue/no-shared-component-data": "error",
    "vue/no-template-key": "error",
    "vue/order-in-components": "error",
    "vue/require-prop-types": "error",
    "vue/require-render-return": "error",
    "vue/require-valid-default-prop": "error",
    "vue/return-in-computed-property": "error",
    "vue/v-bind-style": "error",
    "vue/v-on-style": "error"
  }
}

Input

<input />
<slot />
<svg><use xlink:href="..."></use></svg>

Expected output

<input>
<slot></slot>
<svg><use xlink:href="..." /></svg>

Actual output

<input >
<slot ></slot>
<svg><use xlink:href="..."/></svg>

The rule just replaces /> with > (or > with />) in the opening tag without considering that a space may need to be removed or added.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions