JSON Not respecting code formatting settings

I have set my JSON code style to be 2 spaces for all of the indentation, yet when I go to format my `composer.json` file it formats it to 4 spaces for indentation. This happens on the most current 2019.3.1. Is there any way around this problem or a fix?

1
5 comments

Just checked the default settings for JSON files in PhpStorm 2019.3.1 and it turns out that 2 spaces are the default for indents and 4 spaces for tabs correspondingly. And here how it looks like for a brand new project with a code style reset to defaults:

Does it look different for you, could you please share? Just in case, did you try changing "Tab size"?

0

It shows correctly on the Code Style preview, but if I format my composer.json file, it uses four spaces.

0

http://prntscr.com/qxgxrg
Do you have anything suspicious here, like, EditorConfig mentioned?

1

Yes it does say EditorConfig

0

I removed that file and it worked. Thank you very much.

0

Please sign in to leave a comment.