How can I set up VSCode to put brackets on the same line?

Viewed 35

From this

{
    "models": [
        {
            "id": "foo",
            "translate": [
                0,
                1,
                2
            ]
        },
        {
            "id": "bar",
            "translate": [
                3,
                4,
                5
            ]
        }
    ]
}

To this

{
    "models": [
        {
            "id": "foo",
            "translate": [0, 1, 2]
        }, {
            "id": "bar",
            "translate": [3, 4, 5]
        }
    ]
}

I don't know if there's a beautifier that has setting for brackets, I can only find settings for curly braces.

1 Answers

Take a look at the FracturedJson VSCode plugin. Its goal is to inline elements as long as they aren't too long or complex (with configurable thresholds).

Disclosure: I'm the author. It's open source under the MIT license.

Related