Open hachre opened 9 years ago
ConvertTabsToSpaces
? I hate tabs btw.
I'd like something like ConvertSpacesToTabs. Right now if you give it a space indented input there is no way to get it changed to tabs like there is with a tab indented input.
Why do you hate tabs?
+1. The Sublime Text plugin uses this to format the TS code, but I use tabs in my project, so it will be nice if you let us set if we want spaces (2 or 4) or tabs in the format (I'm not even asking to do so on the output, but it also would be nice).
Why do you hate tabs
I don't have a good answer :rose:
Why do you hate tabs?
Why don't you love spaces? :wink:
@DanielRosenwasser Beause I like to have control over the indendation depth when I view files and because I find it easier to make a "single space" mistake in indendation than a "single tab" mistake because the differene is way more obvious. It's just a preference ;)
@DanielRosenwasser because, in my opinion, spaces are "dirty". Tabs allow more control about indentation, are characters designed to indent, and are only one, instead of 2 or 4 like spaces...
Besides, the thing here is not to have one or the other, the thing is to have the option to choose.
I've just done a pull request adding a --indentStyle parameter in order to address issues like this one: #2768
Thanks @lucasmciruzzi
@lucasmciruzzi, i do not see how #2768 is related to this issue. your change targets the generated js, and not the language service formatting for typescript files.
The formatter described in the link below currently doesn't seem to offer a way to indent by using tabs. https://github.com/Microsoft/TypeScript/wiki/Using-the-Compiler-API#pretty-printer-using-the-ls-formatter
Could that be added? Thanks!