This rule enforces newlines between tags.

How to use

module.exports = {
  rules: {
    "@html-eslint/element-newline": "error",

Rule Details

Examples of incorrect code for this rule:


Examples of correct code for this rule:



This rule has an object option:

  1. "skip": skips newline checking for the specified element's children.
"@html-eslint/element-newline": ["error", {
  "skip": Array<string>


You can specify list of tag names in the skip option. Newline checking is not performed on children of the specified tags.

Examples of correct code for the { "skip": ["pre", "code"] } option: