# html-comment-indent

Rule `vue/html-comment-indent`. Enforce consistent indentation in HTML comments

- Source: vue
- Technologies: Vue
- Kind: style
- Needs type information: no
- Autofix: yes, in at least one linter
- Reach: 0 weekly downloads of presets that enable it
- Trend: 0% last quarter
- Rank: #2049 by reach

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `vue/html-comment-indent` | no | safe | package `eslint-plugin-vue` | [docs](https://eslint.vuejs.org/rules/html-comment-indent.html) |

## Code examples

### Incorrect: the rule reports this

```vue
  <!--
  comment
      comment
  -->
  <!--
    comment
    -->
    <!--
    comment
  -->
</template>
```

### Correct: the rule accepts this

```vue
<!--
  comment
-->
<!--
  comment
  comment
-->
  <!--
    comment
  -->
```

Examples from the ESLint documentation.

## Enable it

### ESLint: `eslint.config.js`

```js
import vue from "eslint-plugin-vue";

export default [
  {
    plugins: { vue },
    rules: {
      "vue/html-comment-indent": "error",
    },
  },
];
```

## Related rules

- [vue/html-comment-content-newline](https://lintradar.dev/rules/vue/html-comment-content-newline.md): Enforce unified line break in HTML comments
- [vue/match-component-import-name](https://lintradar.dev/rules/vue/match-component-import-name.md): Require the registered component name to match the imported component name
- [vue/func-call-spacing](https://lintradar.dev/rules/vue/func-call-spacing.md): Require or disallow spacing between function identifiers and their invocations in `<template>`
- [vue/max-len](https://lintradar.dev/rules/vue/max-len.md): Enforce a maximum line length in `.vue` files
- [vue/array-element-newline](https://lintradar.dev/rules/vue/array-element-newline.md): Enforce line breaks after each array element in `<template>`
- [vue/max-lines-per-block](https://lintradar.dev/rules/vue/max-lines-per-block.md): Enforce maximum number of lines in Vue SFC blocks

---

Web page: https://lintradar.dev/rules/vue/html-comment-indent. Data from npm and the linters' documentation, collected Dec 4, 2026. Site guide for agents: https://lintradar.dev/llms.txt
