eol-last
Configuration
rslint.config.ts
Require or disallow newline at the end of files.
Rule Details
This rule enforces at least one newline (or the absence thereof) at the end of non-empty files.
Trailing newlines in non-empty files are a common UNIX idiom. Benefits include the ability to concatenate or append to files and to output files to the terminal without interfering with shell prompts.
Options
This rule has a string option:
"always"(default) requires the file to end with at least one newline (\nor\r\n)."never"disallows any trailing newline at the end of the file.
always
Examples of incorrect code for this rule with the default "always" option:
Examples of correct code for this rule with the default "always" option:
never
Examples of incorrect code for this rule with the "never" option:
Examples of correct code for this rule with the "never" option: