# multiline-html-element-content-newline

Rule `vue/multiline-html-element-content-newline`. Require a line break before and after the contents of a multiline element

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

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `vue/multiline-html-element-content-newline` | yes | safe | package `eslint-plugin-vue` | [docs](https://eslint.vuejs.org/rules/multiline-html-element-content-newline.html) |

## Code examples

### Incorrect: the rule reports this

```vue
  <div>multiline
    content</div>

  <div
    attr
  >multiline start tag</div>

  <table><tr><td>multiline</td>
    <td>children</td></tr></table>

  <div><!-- multiline
    comment --></div>

  <div
  ></div>
</template>
```

```vue
  <div>content
    content</div>
</template>
```

```vue
  <div class="red"> <!-- or "blue" --> content
  </div>
</template>
```

### Correct: the rule accepts this

```vue
<div>
  multiline
  content
</div>

<pre>some
content</pre>

<div
  attr
>
  multiline start tag
</div>

<table>
  <tr>
    <td>multiline</td>
    <td>children</td>
  </tr>
</table>

<div>
  <!-- multiline
       comment -->
</div>

<div
>
</div>

<div attr>singleline element</div>
```

```vue
  <VueComponent>multiline
  content</VueComponent>

  <pre>some
  content</pre>

  <VueComponent><span
    class="bold">For example,</span>
  Defines the Vue component that accepts preformatted text.</VueComponent>
</template>
```

```vue
<div>
  content
</div>
<div>

  content

</div>
```

Examples from the ESLint documentation.

## Enable it

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

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

export default [
  {
    plugins: { vue },
    rules: {
      "vue/multiline-html-element-content-newline": "error",
    },
  },
];
```

## Presets that enable it

| Preset | Linter | Package | Rules | Weekly downloads | Trend |
| --- | --- | --- | --- | --- | --- |
| [Vue recommended](https://lintradar.dev/presets/vue-recommended.md) | ESLint | `eslint-plugin-vue` | 118 | 9.5M | +46.6% |
| [Vue strongly recommended](https://lintradar.dev/presets/vue-strongly-recommended.md) | ESLint | `eslint-plugin-vue` | 110 | 9.5M | +46.6% |
| [Anthony Fu's config](https://lintradar.dev/presets/antfu.md) | ESLint | `@antfu/eslint-config` | 294 | 758.7K | +49.9% |

## Related rules

- [vue/html-quotes](https://lintradar.dev/rules/vue/html-quotes.md): Enforce quotes style of HTML attributes
- [vue/mustache-interpolation-spacing](https://lintradar.dev/rules/vue/mustache-interpolation-spacing.md): Enforce unified spacing in mustache interpolations
- [vue/html-indent](https://lintradar.dev/rules/vue/html-indent.md): Enforce consistent indentation in `<template>`
- [vue/no-multi-spaces](https://lintradar.dev/rules/vue/no-multi-spaces.md): Disallow multiple spaces
- [vue/html-closing-bracket-spacing](https://lintradar.dev/rules/vue/html-closing-bracket-spacing.md): Require or disallow a space before tag's closing brackets
- [vue/no-spaces-around-equal-signs-in-attribute](https://lintradar.dev/rules/vue/no-spaces-around-equal-signs-in-attribute.md): Disallow spaces around equal signs in attribute

---

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