Skip to content

single line width for objects #16

@LRueckert

Description

@LRueckert

It's awesome that you allow for short arrays to be printed in single line. I would like to suggest extending this option also to objects and maybe even objects nested in arrays which are still short.

So that:

{
  "shortArray": [1, 2, 3, 4],
  "shortObject": {
    "code:": "some_code",
    "value": 13262234
  },
  "shortNested": [
    {
      "something": "any value",
      "stuff": 12345
    }
  ]
}

instead becomes

{
  "shortArray": [1, 2, 3, 4],
  "shortObject": { "code:": "some_code", "value": 13262234 },
  "shortNested": [{ "something": "any value", "stuff": 12345 }]
}

When a single prop object takes 3 lines instead of one and you have a long file it can make a big difference.
I can see how not everyone would want this, especially with shorter JSON files, but maybe that could be optional as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions