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 else
reject(new Error("Unknown language for Prettier")) reject(new Error("Unknown language for Prettier"))
filePath = atom.workspace.getActiveTextEditor().getPath()
try try
result = prettier.format(text, { prettier.resolveConfig(filePath).then((configOptions) ->
options result = prettier.format(text, configOptions or options, parser)
parser prettier.clearConfigCache()
}) resolve result
resolve result )
catch err catch err
reject(err) reject(err)
) )