Skip to content

Latest commit

 

History

History
25 lines (17 loc) · 616 Bytes

README.md

File metadata and controls

25 lines (17 loc) · 616 Bytes

prettier-eslint-emacs

Auto-format current buffer with prettier-eslint

Usage

M-x prettier-eslint

To automatically format after saving:

(add-hook 'js2-mode-hook (lambda () (add-hook 'after-save-hook 'prettier-eslint nil t)))
(add-hook 'react-mode-hook (lambda () (add-hook 'after-save-hook 'prettier-eslint nil t)))

In Spacemacs add the above to your dotspacemacs/user-config

Otherwise:

(eval-after-load 'js2-mode
  '(add-hook 'js2-mode-hook (lambda () (add-hook 'after-save-hook 'prettier-eslint nil t))))

LICENSE

MIT