spacemacs-prettier
spacemacs-prettier copied to clipboard
Adds prettier-js formatter to spacemacs locally. Temporary solution until prettier-js is launched on MELPA
Deprecated
This package is no longer needed as prettier-js was added to MELPA
- To install the MELPA package add prettier-js to
dotspacemacs-additional-packagesin your spacemacs file.
Instructions
- Clone this project into
~/.emacs.d/private/ - Add
~/.emacs.d/private/todotspacemacs-configuration-layer-path - Add
spacemacs-prettiertodotspacemacs-configuration-layers - Install prettier-js
yarn global add prettierornpm i -g prettier
Enable on-save
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)
...
Optional Args
You can set prettier arguments in your .spacemacs file:
;; prettier settings
(setq prettier-js-args '(
"--trailing-comma" "all"
"--bracket-spacing" "false"
))