This package is no longer needed as prettier-js was added to MELPA
- To install the MELPA package add prettier-js to
dotspacemacs-additional-packages
in your spacemacs file.
- Clone this project into
~/.emacs.d/private/
- Add
~/.emacs.d/private/
todotspacemacs-configuration-layer-path
- Add
spacemacs-prettier
todotspacemacs-configuration-layers
- Install prettier-js
yarn global add prettier
ornpm i -g prettier
If you want prettier to run on save you need to add the hooks to your favourite javascript mode(s) into your .spacemacs
file
(add-hook 'js2-mode-hook 'prettier-js-mode)
(add-hook 'web-mode-hook 'prettier-js-mode)
...
You can set prettier arguments in your .spacemacs file:
;; prettier settings
(setq prettier-js-args '(
"--trailing-comma" "all"
"--bracket-spacing" "false"
))