I remember in previous versions of VS Pro that I used there used to be a configuration in: Options -> Text Editor -> JSON -> Tabs
to specify what indentation I need for JSON files. I am currently using VS 2019 and I don't see an item for JSON
under Text Editor
. Did the procedure for setting up JSON indentation change? Am I looking in the wrong place? Did I forget to install something?
Asked
Active
Viewed 945 times
2

Denis
- 11,796
- 16
- 88
- 150
1 Answers
2
Create a .editorconfig
file in the base of your project and enable overriding of config in VS settings:
root = true
[*]
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = space
[*.cs]
indent_size = 4
[*.{ps1,xml,json}]
indent_size = 2

Denis
- 11,796
- 16
- 88
- 150