prettier / prettier-emacs

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

Can anybody write a prettier-standard emacs package? #40

Closed adispring closed 6 years ago

adispring commented 6 years ago

using prettier-standard :https://github.com/sheerun/prettier-standard

nickserv commented 6 years ago

Set prettier-js-command to "prettier-standard".

adispring commented 6 years ago

Yes,I replace all prettier-js to prettier-standard-js, it works!. This is my forked repo:https://github.com/adispring/prettier-emacs/blob/master/prettier-standard-js.el

and the temporary package install method:

    (prettier-standard-js :location (recipe
                         :fetcher github
                         :repo "adispring/prettier-emacs")) ;; prettier-standard,from github
nickserv commented 6 years ago

Honestly you don't need your own package, it's one line of configuration to use with this package and you won't have to worry about maintaining updates.

(setq prettier-js-command "prettier-standard")
adispring commented 6 years ago

Yeah, that works. Great!

ezmiller commented 5 years ago

Is there a good way to change the prettier-js-command on a per project basis? I tried to use the directory variables feature by placing the following in a .dir-locals.el file:

((nil . ((prettier-js-command . "prettier-standard"))))

But I got a message saying that it was dangerous to set the prettier-js-command on a per-file basis.

adispring commented 5 years ago

I use spacemacs, and this is my configuration: https://github.com/adispring/spacemacsDotD/blob/master/layers/adispring/packages.el#L176