federomero / pretty-json

Atom plugin. Format JSON documents.
MIT License
94 stars 23 forks source link

Feature Request: Ensure single newline ending when prettify on save is enabled #67

Open bradoyler opened 7 years ago

bradoyler commented 7 years ago

One annoyance I have is that when saving json files it removes the newline ending. Would it be ok to turn off the removal of newline on save?

lexicalunit commented 7 years ago

Ugh, I also hate when files don't end with a newline. Yuck, even having Atom's whitespace package installed, enabled, and configured to enable Ensure Single Trailing Newline doesn't help.

screen shot 2017-05-04 at 10 15 47 am

I can't work on this right this minute but I'll try to fix it soon. Thanks for the ticket!

jnields commented 6 years ago

Ideally this could come from a .editorconfig file... along with indent size / style and newline style,

lexicalunit commented 6 years ago

@jnields there's at least one (maybe more) editorconfig packages for Atom that should, in theory, make this work. Those packages would set Ensure Single Trailing Newline properly, and then the pretty-json package should correctly honor that setting.