Preserve new line at end of file
See original GitHub issueHi,
The js-beautify will remove the last new line before inside the HTML script tag. For example the new line in the following HTML script,
<head>
<script>
mocha.setup('bdd');
</script>
</head>
will be removed after js-beautify reformatted the file,
<head>
<script>
mocha.setup('bdd');
</script>
</head>
However, the problem is ESLint will complaint that a newline required at end of file but not found (eol-last).
May I know if we can configure js-beautify not to remove the last newline?
Issue Analytics
- State:
- Created 9 years ago
- Comments:12 (3 by maintainers)
Top Results From Across the Web
How to add a newline to the end of a file?
Here you go: sed -i -e '$a\' file. And alternatively for OS X sed : sed -i '' -e '$a\' file. This adds...
Read more >No Newline at End of File
So, it turns out that, according to POSIX, every text file (including Ruby and JavaScript source files) should end with a \n ,...
Read more >Why should text files end with a newline?
text file (each line is supposed to end in an end-of-line); binary file (there are no true "lines" to speak of, and the...
Read more >How to Preserve Newlines, Line Breaks, and Whitespace in ...
Preserve Newlines, Line Breaks, and Whitespace in HTML. Use the white-space: pre; setting to display long-form content containing whitespace ...
Read more >Sublime Text: Add NewLine at EOF on Save - ShellHacks
A Sublime Text can be configured to add a newline character automatically on a file save, using the ensure_newline_at_eof_on_save option ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@nelson6e65 This is not atom-beautify, sorry. You’ll need to address the issue in that project.
@jonkri Settings overrides should work for this. Set the html (or root) setting to
true
and set the value forjs
andcss
children tofalse
. It would look something like this.