Cannot change tabulation size
Hi There Is there a way to set the tab size to 4 spaces instead of 2 of the new generated files?
Cheers Alban
In the .editorconfig set indent_size = 4
Already done, but this does not affect the Angular CLI
The CLI doesn't provide this kind of functionality for scaffolded code, but you're more than welcome to format your code however you please.
But this way one has to format the code every time he generates a new file. I will contribute and add this function.
I agree that it is frustrating to have to reformat every file the cli spits out just so you can have the tab spacing you are chasing. Could the cli not reference .editorconfig when creating new files @filipesilva?
For Sublime users this setting in your Syntax Specific settings may help change the tabs to 2 spaces for ts files but not your other files.
https://forum.sublimetext.com/t/set-tab-size-for-different-file-type/6807/4
I don't think there's a way to do that at the moment, but haven't investigated it much.
@DesHorsley I can confirm that the CLI is not referencing the editorconfig for any code format
Why is this ticket closed? It seems like a logical feature to have and I don't see any other issues mentioning this functionality.
+1 for "why is this closed?" Two-space indentation is just.. ick.
+1 I find this frustrating as well. I use WebStorm, and while I've got Webstorm setup to use 4 spaces for tabs, it also tries really hard to honor an existing file's pattern for tabs. This lack of capability in angular-cli makes me have to fight my editor whenever I use angular-cli, which I think goes against the whole point of the cli to begin with.
Just want to throw in my +1 on having this option, reading from .editorconfig.
Additionally, it would be great to be able to use tab characters instead of spaces.
+1 for bumping this issue.
+1, having to change every file manually is tedious
+1, seems like a fairly reasonable PR candidate
+1, great tool but this problem is very frustrating
+1, this would be really useful
+1 for me as well!
+1 for this. Very frustrating to edit the generated file every time for 4 spaces.
Why the ticket is closed btw?
+1 for me as well, I'm not happy to reindent each newly created file.
+1. Would be very happy if CLI could read from either .editorconfig or the angular-cli.json.