Skip to content

html-indent reports false positive. #729

Closed
@ota-meshi

Description

@ota-meshi

Tell us about your environment

  • ESLint version: 5.10.0
  • eslint-plugin-vue version: 5.0.0
  • Node version: 8.11.3

Please show your full configuration:

module.exports = {
  rules: {
    "vue/html-indent": ["error"]
  }

What did you do?

<template>
  <div>text
    <a/>
  </div>
  <div>text
    text
    <a/>
  </div>
  <div><a/>
    <a/>
  </div>

  <!-- when there is a line break before the first content -->
  <div>
    <a/>
    <a/>
  </div>
  <div>
    text
    <a/>
  </div>
  <div>
    text
    text
    <a/>
  </div>
</template>

What did you expect to happen?
I think there is no errors.

What actually happened?

If there is no line break before the first content, false positives are reported.

Expected indentation of 2 spaces but found 4 spaces. [vue/html-indent] (3, 1)
Expected indentation of 2 spaces but found 4 spaces. [vue/html-indent] (6, 1)
Expected indentation of 2 spaces but found 4 spaces. [vue/html-indent] (7, 1)
Expected indentation of 7 spaces but found 4 spaces. [vue/html-indent] (10, 1)

image

fixed:

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions