End Newline

Whether or not files should end with an empty newline. This is a global rule definition and will be used for all languages. The Recommended option to use is true which will insert a newline at the end of documents.


🧐

false

The global endNewline rule is disabled (i.e: false) by default. This will result in newline occurrences at the end of documents/files to be stripped. In the below sample, the newline is removed after formatting.

<header>
<h1>Hello World</h1>
<p>
  The newline at the end of this sample will be stripped.
</p>
</header>

<header>
  <h1>Hello World</h1>
  <p>
    The newline at the end of this sample will be stripped.
  </p>
</header>

🧐

true

When the global endNewline rule is enabled (i.e: true) then documents/files will always end with a newline. If a document ends with multiple newlines then they will be stripped and replaced with a single newline only.

<header>
<h1>Hello World</h1>
<p>
  A newline will be inserted at the bottom of this sample
</p>
</header>
<header>
  <h1>Hello World</h1>
  <p>
    A newline will be inserted at the bottom of this sample
  </p>
</header>