I can't remember exactly but a good convention is to always end on a blank line. This should be possible to auto-configure sublime to do that.