Skip to content

Files

Latest commit

 

History

History
125 lines (93 loc) · 1.67 KB

html-comment-indent.md

File metadata and controls

125 lines (93 loc) · 1.67 KB

Pattern: Inconsistent HTML comment indent

Issue: -

Description

This rule enforces a consistent indentation style in HTML comment (<!-- ... -->). The default style is 2 spaces.

<template>
  <!-- ✓ GOOD -->
  <!--
    comment
  -->
  <!--
    comment
    comment
  -->
    <!--
      comment
    -->

  <!-- ✗ BAD -->
  <!--
  comment
      comment
  -->
  <!--
    comment
    -->
    <!--
    comment
  -->
</template>

Options

{
  "vue/html-comment-indent": ["error", type]
}
  • type (number | "tab") ... The type of indentation. Default is 2. If this is a number, it's the number of spaces for one indent. If this is "tab", it uses one tab for one indent.

2

<template>
  <!--
    ✓ GOOD
  -->

  <!--
   ✗ BAD
  -->
</template>

4

<template>
  <!--
      ✓ GOOD
  -->

  <!--
    ✗ BAD
  -->
</template>

0

<template>
  <!--
  ✓ GOOD
  -->

  <!--
    ✗ BAD
  -->
</template>

"tab"

<template>
  <!--
  	✓ GOOD
  -->

  <!--
    ✗ BAD
  -->
</template>

Further Reading