Prettier and Spacemacs

Install prettier executable

The emacs mode requires the prettier executable to be installed. The easiest way to install prettier for me was to install it with npm global:

npm install --global prettier

Install prettier-js-mode

prettier-js is no available via Melpa, so the setup is quiet easy:

  • Open your .spacemacs (with SPC f e d)
  • Search for dotspacemacs-additional-packages
  • add prettier-js to it


dotspacemacs-additional-packages '(simpleclip prettier-js)`

Configure on-save

Search for dotspacemacs/user-config and add these two lines to it:

  (add-hook 'js2-mode-hook 'prettier-js-mode)
  (add-hook 'web-mode-hook 'prettier-js-mode)


Now you can just reload your .spacemacs (SPC f e R) or restart emacs and prettier is available.

Dennis Sivia

Dennis Sivia
I am passionate about technology and especially having a lot of fun with functional programming and computer science.

Getting started with Raspberry PI 3, Python and Elixir

Setup for implementing various raspberry sensors setups using elixir and python Continue reading

Elixir, Phoenix 1.3 , Elm and Webpack 3

Published on November 01, 2017

Programming in Elm - Part 2 Fuzz testing

Published on August 01, 2017