Fix options not working from Atom UI and config file

This commit is contained in:
Steven Zeck 2018-02-20 11:50:17 -06:00
parent 1de54efef4
commit db80ba6ac7
1 changed files with 7 additions and 5 deletions

View File

@ -33,12 +33,14 @@ module.exports = class Prettier extends Beautifier
else
reject(new Error("Unknown language for Prettier"))
filePath = atom.workspace.getActiveTextEditor().getPath()
try
result = prettier.format(text, {
options
parser
})
resolve result
prettier.resolveConfig(filePath).then((configOptions) ->
result = prettier.format(text, configOptions or options, parser)
prettier.clearConfigCache()
resolve result
)
catch err
reject(err)
)