Currently, AFAIK, the JSON module does not provide out-of-the-box a way of pretty encoding a term into JSON, but checking the Erlang docs, it seems that we have since v27.1
a format function that encodes terms into JSON with additional whitespaces for better formatting.
I wonder if Elixir's JSON module should use this function by default when encoding terms.