Skip to content

Adds prettier-js formatter to spacemacs locally. Temporary solution until prettier-js is launched on MELPA

Notifications You must be signed in to change notification settings

praveenperera/spacemacs-prettier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 

Repository files navigation

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-packages in your spacemacs file.


Instructions

  1. Clone this project into ~/.emacs.d/private/
  2. Add ~/.emacs.d/private/ to dotspacemacs-configuration-layer-path
  3. Add spacemacs-prettier to dotspacemacs-configuration-layers
  4. Install prettier-js yarn global add prettier or npm 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"
  ))

About

Adds prettier-js formatter to spacemacs locally. Temporary solution until prettier-js is launched on MELPA

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published