Visual Studio 2022 JSON Array Formatting

93 views Asked by At

With VS 2022 (no extensions), JSON files are being formatted with spaces inside the array braces, i.e.,:

{
  "key": [ "val1","val2","val3" ]
}

The preference is to have no spacing between the start/end of the array braces, i.e.,:

{
  "key": ["val1","val2","val3"]
}

I've gone through VS editor settings and cannot seem to find anything directly related to the spaces.

I've also tried with an .editorconfig:

[*.json]
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true
array_element_spacing = false

Any suggestions on how to have VS formatting enforce the rule where there are no spaces after the opening brace and before the closing brace of a json array? Ideally using a .editorconfig setting.

0

There are 0 answers