Merge pull request #1021 from ziacik/fix-typescript-formatter
Fix incorrent enforcement of tabs to spaces conversion in typescript
This commit is contained in:
commit
efb0dff34e
|
@ -16,10 +16,14 @@ module.exports = class TypeScriptFormatter extends Beautifier
|
||||||
# @verbose('format', format, formatterUtils)
|
# @verbose('format', format, formatterUtils)
|
||||||
|
|
||||||
opts = formatterUtils.createDefaultFormatCodeOptions()
|
opts = formatterUtils.createDefaultFormatCodeOptions()
|
||||||
opts.TabSize = options.tab_width or options.indent_size
|
|
||||||
opts.IndentSize = options.indent_size
|
if options.indent_with_tabs
|
||||||
opts.IndentStyle = 'space'
|
opts.ConvertTabsToSpaces = false
|
||||||
opts.convertTabsToSpaces = true
|
else
|
||||||
|
opts.TabSize = options.tab_width or options.indent_size
|
||||||
|
opts.IndentSize = options.indent_size
|
||||||
|
opts.IndentStyle = 'space'
|
||||||
|
|
||||||
@verbose('typescript', text, opts)
|
@verbose('typescript', text, opts)
|
||||||
result = format('', text, opts)
|
result = format('', text, opts)
|
||||||
@verbose(result)
|
@verbose(result)
|
||||||
|
|
Loading…
Reference in New Issue