From 31817f8452e1fb7baee4b1332950a40c782f7bbc Mon Sep 17 00:00:00 2001 From: Lucien Cartier-Tilet Date: Fri, 12 Aug 2022 17:55:59 +0200 Subject: [PATCH] [Emacs] Enable prettier-js and lsp for webmode by default --- org/config/emacs.org | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/org/config/emacs.org b/org/config/emacs.org index 7fdb971..0125ef9 100644 --- a/org/config/emacs.org +++ b/org/config/emacs.org @@ -7309,8 +7309,11 @@ languages in the same buffer, mainly HTML, CSS, and Javascript. #+begin_src emacs-lisp (use-package web-mode :defer t + :after (prettier-js) :straight (:build t) - :hook ((html-mode . web-mode)) + :hook ((html-mode . web-mode) + (web-mode . lsp-deferred) + (web-mode . prettier-js-mode)) :mode (("\\.phtml\\'" . web-mode) ("\\.tpl\\.php\\'" . web-mode) ("\\.twig\\'" . web-mode) @@ -7494,8 +7497,8 @@ And finally, here is a formatter for Javascript. (use-package prettier-js :defer t :straight (:build t) - :after (rjsx-mode web-mode typescript-mode) - :hook ((rjsx-mode web-mode typescript-mode) . prettier-js-mode) + :after (rjsx-mode typescript-mode) + :hook ((rjsx-mode typescript-mode) . prettier-js-mode) :config (csetq prettier-js-args '("--single-quote" "--jsx-single-quote"))) #+end_src