summary refs log tree commit diff stats
path: root/emacs
diff options
context:
space:
mode:
authorAlan Pearce2018-09-07 17:10:04 +0200
committerAlan Pearce2018-09-07 17:10:04 +0200
commit2c275841789ae9558585646cec3e18cad292f603 (patch)
tree101fdb9b27e2bf772c7aff47e52b4b1d1cc580cb /emacs
parente1834dda554a1f108d7a17588571191417f7d15e (diff)
downloadnixfiles-2c275841789ae9558585646cec3e18cad292f603.tar.lz
nixfiles-2c275841789ae9558585646cec3e18cad292f603.tar.zst
nixfiles-2c275841789ae9558585646cec3e18cad292f603.zip
Emacs: Configure prettier-js
Diffstat (limited to 'emacs')
-rw-r--r--emacs/.emacs.d/main.el9
1 files changed, 9 insertions, 0 deletions
diff --git a/emacs/.emacs.d/main.el b/emacs/.emacs.d/main.el
index 65eae69a..cdd65dab 100644
--- a/emacs/.emacs.d/main.el
+++ b/emacs/.emacs.d/main.el
@@ -2024,6 +2024,15 @@ With two prefix arguments, write out the day and month name."
               (when (executable-find "standard")
                 (setq-local flycheck-javascript-standard-executable (executable-find "standard"))))))
 
+;;;;;;; Prettier
+
+;; Reformat files on save
+
+(use-package prettier-js
+  :config (progn
+            (add-hook 'typescript-mode #'prettier-js-mode)
+            (add-hook 'js2-mode #'prettier-js-mode)))
+
 ;;;;;;; Indium
 
 ;; Javascript with an inferior node.js process and a debugger?  Awesome.