Closed mourner closed 10 years ago
Hmm. I've never considered this. It seems rather trivial and inconsequential though. I'll leave this issue open for awhile and see if others feel similarly.
Some background: http://robots.thoughtbot.com/no-newline-at-end-of-file
After being in this field for so long, I wasn't aware of this expectation or convention. I thought it was just a nitpicky preference, much like the difference between 2 space indentation or 4 space. You've convinced me. Another discussion: http://stackoverflow.com/questions/729692/why-should-files-end-with-a-newline
So it seems to me that in all cases, it should be terminated with a \n
. Right?
I think so, but the issue here is not as much about adhering to conventions as it is about not breaking existing conventions in the project. E.g. npm init
creates package.json
with a new line at eof, and I think it will also add one when rewriting the file when you do install --save
.
Thanks!
Git, GitHub and many conventions generally recommend having a line break at the end of file. When you run tin, it doesn't preserve line breaks that already present, so e.g. if I have a package.json with \n at eof, it will be removed.