Code style scheme for 1TBS (javscript/ json)

Hi guys, would anyone know if it would be possible to have 1TBS (one true brace style) type of scheme for brackets in IntelliJ?

I want to use the following type of nested objects in arrays

       "some": [{
            "foo": "bar"
        }]

 

IntelliJs code style only allows me to format it like some GNU style of indentation:

 

        "some": [
            {
                "foo": "bar"
            }
        ]
0
4 comments

Settings | Editor | Code Style | JavaScript | Wrapping and Braces, Array initializer:

- Do not wrap

- New line after '[' = off

- Place ']' on new line = off

To format

"some": [
{
"foo": "bar"
}
]

to

"some": [{
"foo": "bar"
}]

make sure to turn 'Keep line breaks' off

 

0
Avatar
Permanently deleted user

What about doing this in JSON?

0
Avatar
Permanently deleted user

Hi Elena,

 

thank you for your swift response. This works for javascript files. However, would it be possible to achieve the same for JSON? There seem to be considerately less options for JSON.

0

there is no such option for JSON unfortunately. Please feel free to create a request for it in youtrack, https://youtrack.jetbrains.com/issues/WEB

0

Please sign in to leave a comment.