Reputation: 97
I'm trying to set indent for TypeScript in Intellij Idea Ultimate.
I'm doing this like others described in previous questions eg. question1, question2.
It's not working in my case.
Indent should be 4, it's set to 4, in preview it looks good, but there is no changes in editor after closing settings window by Apply
and Ok
and formatting code by shortcut Ctrl + Alt + L
Could you tell me what i'm doing incorrect ?
Upvotes: 4
Views: 3547
Reputation: 4102
Check that your file is not already indented with 2 (or another number) spaces. As Intelliji/Webstorm always favor current indentation. If that is your case, you can fix that by manually indenting your file to 4 spaces, once.
One faster way to do it, is to remove all indentation, by doing shift-tab multiple times, on the whole file, then doing ctrl+alt+L.
Also check indentation settings in your tslint.json or eslint.json file if you have one.
Upvotes: 1