1 # require or disallow newline at the end of files (eol-last)
3 Trailing newlines in non-empty files are a common UNIX idiom. Benefits of
4 trailing newlines include the ability to concatenate or append to files as well
5 as output files to the terminal without interfering with shell prompts.
9 This rule enforces at least one newline (or absence thereof) at the end
12 Prior to v0.16.0 this rule also enforced that there was only a single line at
13 the end of the file. If you still want this behavior, consider enabling
14 [no-multiple-empty-lines](no-multiple-empty-lines.md) with `maxEOF` and/or
15 [no-trailing-spaces](no-trailing-spaces.md).
17 Examples of **incorrect** code for this rule:
20 /*eslint eol-last: ["error", "always"]*/
27 Examples of **correct** code for this rule:
30 /*eslint eol-last: ["error", "always"]*/
39 This rule has a string option:
41 * `"always"` (default) enforces that files end with a newline (LF)
42 * `"never"` enforces that files do not end with a newline
43 * `"unix"` (deprecated) is identical to "always"
44 * `"windows"` (deprecated) is identical to "always", but will use a CRLF character when autofixing
46 **Deprecated:** The options `"unix"` and `"windows"` are deprecated. If you need to enforce a specific linebreak style, use this rule in conjunction with `linebreak-style`.