federomero / pretty-json

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

Feature Request: Do not stringify numbers when using "Sort and Prettify" #62

Closed danmackinlay closed 5 years ago

danmackinlay commented 7 years ago

This {"foo": -0.6579373322603248 } is converted to this

{
  "foo": "-0.6579373322603248"
}

when I sort and prettify.

This is bad, since I now have strings instead of numbers, and my json validator throws an exception.

lexicalunit commented 7 years ago

Sorry for the delay in response. I only just now saw this message in my email (plus a lot of other github messages, maybe there was some outage?).

lexicalunit commented 7 years ago

So this is due to the fix for #49. This only happens when using "Sort and Prettify" because of the use of json-stable-stringify.

lexicalunit commented 6 years ago

See also: #46 - Feature Request: Prevent side effects that change the format of Numbers.