fix typescript support
This commit is contained in:
parent
9148d3eea5
commit
25e2a754d5
|
@ -10,13 +10,13 @@ module.exports = class TypeScriptFormatter extends Beautifier
|
||||||
beautify: (text, language, options) ->
|
beautify: (text, language, options) ->
|
||||||
return new @Promise((resolve, reject) ->
|
return new @Promise((resolve, reject) ->
|
||||||
|
|
||||||
TF = require("typescript-formatter/typescript-toolbox/lib/formatter")
|
format = require("typescript-formatter/lib/formatter")
|
||||||
opts = TF.createDefaultFormatCodeOptions()
|
|
||||||
|
|
||||||
|
opts = {}
|
||||||
opts.TabSize = options.tab_width
|
opts.TabSize = options.tab_width
|
||||||
opts.IndentSize = options.indent_size
|
opts.IndentSize = options.indent_size
|
||||||
|
|
||||||
result = TF.applyFormatterToContent(text, opts)
|
result = format(text, opts)
|
||||||
resolve result
|
resolve result
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue