all repos — nixfiles @ 3279bb50a2e6c5a9f2bc1e4035d2a5da509714d7

System and user configuration, managed by nix and home-manager

Emacs: replace prettier-js and sqlformat with format-all
Alan Pearce alan@alanpearce.eu
Sat, 24 Oct 2020 18:45:51 +0200
commit

3279bb50a2e6c5a9f2bc1e4035d2a5da509714d7

parent

1f5a6f18fa58bfd7e4251b560ce07887177100ae

2 files changed, 15 insertions(+), 12 deletions(-)

jump to
M user/emacs/init.eluser/emacs/init.el
@@ -935,16 +935,20 @@ (setq company-backends (remq 'company-tide company-backends))))) 
 ;;;; Reformat on save
 
-(use-package prettier-js
-  :ghook ('(javascript-mode-hook typescript-mode-hook) #'prettier-js-mode t)
-  :config (progn
-            (setq prettier-js-show-errors 'echo)))
-
-(use-package sqlformat
-  :ghook ('sql-mode-hook #'sqlformat-on-save-mode)
-  :config (progn
-            (setq sqlformat-command 'pgformatter
-                  sqlformat-args '("-s2"))))
+(use-package format-all
+  :ghook ('(css-mode-hook
+            dockerfile-mode-hook
+            emacs-lisp-mode-hook
+            javascript-mode-hook
+            json-mode-hook
+            markdown-mode-hook
+            scss-mode-hook
+            sgml-mode-hook
+            sh-mode-hook
+            sql-mode-hook
+            toml-mode-hook
+            typescript-mode-hook
+            yaml-mode-hook)))
 
 ;;; E-mail
 
M user/settings/emacs.nixuser/settings/emacs.nix
@@ -119,6 +119,7 @@ evil-space       evil-surround
       eyebrowse
       feature-mode
+      format-all
       fish-completion
       flycheck
       general
@@ -157,7 +158,6 @@ org-journal       paredit
       php-mode
       posframe
-      prettier-js
       projectile
       projectile-ripgrep
       quickrun
@@ -167,7 +167,6 @@ ripgrep       rjsx-mode
       scss-mode
       spacemacs-theme
-      sqlformat
       swiper
       tide
       toml-mode