prettier / prettier-emacs

Minor mode to format JS code on file save
http://jlongster.com/A-Prettier-Formatter
375 stars 54 forks source link

[Feature Request] add an option to prefer prettier-eslint #31

Closed maple-leaf closed 6 years ago

maple-leaf commented 6 years ago

Please add an option to prefer prettier-eslint when has prettier-eslint installed locally or globally, use it, else use prettier :-)

rcoedo commented 6 years ago

There is a prettier-js-command variable that controls which command is used. You can get the behavior you want by checking if you have prettier-eslint in your path and set the one you want as prettier-js-command.

Cheers!

maple-leaf commented 6 years ago

Thanks :-)

benjamin-rood commented 6 years ago

@rcoedo Hi Roman, still a emacs newbie, what do I need to configure in my init file to set the prettier-js-command variable to use prettier-eslint?

nickserv commented 6 years ago
(setq prettier-js-command "prettier-eslint")
peter-wd-1 commented 2 years ago

How can I solve this error? I have installed prettier-eslint globally. (before-save-hook): Error running hook "prettier-js" because: (file-missing Searching for program No such file or directory prettier-eslint)