Closed rivy closed 3 years ago
Released in 0.11.0. Use "preferSingleLine": true
or more specifically "array.preferSingleLine": true
or "object.preferSingleLine": true
.
In fact, while thinking about this post, it occurs to me that a "global" version of 'preferSingleLine' indicating a default to capable plugins might be a useful option to help create the same output no matter the form (basically differing only in whitespace).
It's a slippery slope to add config to the global area that might only be shared by a couple plugins, so I'm leaving that global config to be only config used by the underlying dprint-core printer which is used by many of the dprint plugins.
Thanks!
Currently, for JSON elements which are split onto multiple lines, but fit into the line length, the multi-line format is always maintained. For example,
won't shrink the excludes entry unless the first entry (".history") is on the initial line.
Ultimately, I'm trying to create repeatable final formatting for files which might be formatted in a different style (eg,
deno
orprettier
). A 'preferSingleLine' option makes that an easier/possible task.In fact, while thinking about this post, it occurs to me that a "global" version of 'preferSingleLine' indicating a default to capable plugins might be a useful option to help create the same output no matter the form (basically differing only in whitespace).