From d005a96ae2941063ab95ecb8d4716d0efa7930f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franti=C5=A1ek=20=C5=BDia=C4=8Dik?= Date: Wed, 15 Jun 2016 11:55:36 +0200 Subject: [PATCH] Fix incorrent enforcement of tabs to spaces conversion in typescript --- src/beautifiers/typescript-formatter.coffee | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) 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)