From db80ba6ac794284f88f1f3d8d7c1fd3ae9ef27f1 Mon Sep 17 00:00:00 2001 From: Steven Zeck Date: Tue, 20 Feb 2018 11:50:17 -0600 Subject: [PATCH] Fix options not working from Atom UI and config file --- src/beautifiers/prettier.coffee | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/beautifiers/prettier.coffee b/src/beautifiers/prettier.coffee index 6ee198a..bd2d12a 100644 --- a/src/beautifiers/prettier.coffee +++ b/src/beautifiers/prettier.coffee @@ -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) ) \ No newline at end of file