Fix options not working from Atom UI and config file
This commit is contained in:
parent
1de54efef4
commit
db80ba6ac7
|
@ -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)
|
||||||
)
|
)
|
Loading…
Reference in New Issue