flow-mono-cli icon indicating copy to clipboard operation
flow-mono-cli copied to clipboard

`align-types` removes end-of-file newline

Open mcous opened this issue 7 years ago • 0 comments
trafficstars

First off: thanks for your work on this tool! It's been helpful. Second off, I came across a little issue:

Some people and tools find it important that files always end with a newline character. After running flow-mono align-types, I've found that it removes the trailing newline from all of my package.jsons.

I think that flow-mono should either:

  1. Always include a trailing newline (or os.EOL maybe?) when writing .json files
  2. Attempt to preserve existing end-of-file newline somehow

If (1) is acceptable, perhaps leaning on a existing package.json writing solution like write-pkg might be easier than maintaining a bespoke one.

mcous avatar Jul 13 '18 17:07 mcous