diff --git a/src/beautifiers/typescript-formatter.coffee b/src/beautifiers/typescript-formatter.coffee index 3b4b873..3e9a555 100644 --- a/src/beautifiers/typescript-formatter.coffee +++ b/src/beautifiers/typescript-formatter.coffee @@ -16,10 +16,14 @@ module.exports = class TypeScriptFormatter extends Beautifier # @verbose('format', format, formatterUtils) opts = formatterUtils.createDefaultFormatCodeOptions() - opts.TabSize = options.tab_width or options.indent_size - opts.IndentSize = options.indent_size - opts.IndentStyle = 'space' - opts.convertTabsToSpaces = true + + if options.indent_with_tabs + opts.ConvertTabsToSpaces = false + else + opts.TabSize = options.tab_width or options.indent_size + opts.IndentSize = options.indent_size + opts.IndentStyle = 'space' + @verbose('typescript', text, opts) result = format('', text, opts) @verbose(result)