How to make IntelliJ IDEA insert a new line at every end of file?
Change your Editor settings:
Settings
→ Editor
→ General
→ Ensure line feed at file end on Save
For MAC users:
Preferences > Editor > General > Ensure every saved file ends with a line break
IntelliJ IDEA 2016.3
Approach 1
File > Settings... > Editor > General > Ensure line feed at file end on Save
Approach 2
Help > Find Action... (Ctrl+Shift+A) > type "Ensure line feed" > switch the toggle to ON (using the mouse click or Enter) for "Other: Ensure line feed at file end on Save" line