From d5cceaf071fde6ab008f609f951a8f1af966dd72 Mon Sep 17 00:00:00 2001 From: Steven Zeck Date: Tue, 6 Mar 2018 12:01:25 -0600 Subject: [PATCH] Fix to send parser to prettier API properly --- src/beautifiers/prettier.coffee | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/beautifiers/prettier.coffee b/src/beautifiers/prettier.coffee index 6d5c4e1..b59d11a 100644 --- a/src/beautifiers/prettier.coffee +++ b/src/beautifiers/prettier.coffee @@ -31,6 +31,7 @@ module.exports = class Prettier extends Beautifier prettierLanguage = _.find(prettier.getSupportInfo().languages, 'name': language) if prettierLanguage parser = prettierLanguage.parsers[0] + options.parser = parser else reject(new Error("Unknown language for Prettier")) @@ -38,7 +39,7 @@ module.exports = class Prettier extends Beautifier try prettier.resolveConfig(filePath).then((configOptions) -> - result = prettier.format(text, configOptions or options, parser) + result = prettier.format(text, configOptions or options) prettier.clearConfigCache() resolve result )