[Emacs] Better web-mode config, cleaner prettier-js config

This commit is contained in:
Lucien Cartier-Tilet 2022-06-26 22:24:49 +02:00
parent bfef9895d6
commit 81a3b67f63
Signed by: phundrak
GPG Key ID: BD7789E705CB8DCA

View File

@ -7251,6 +7251,12 @@ languages in the same buffer, mainly HTML, CSS, and Javascript.
("\\.ctp\\'" . web-mode) ("\\.ctp\\'" . web-mode)
("\\.djhtml\\'" . web-mode) ("\\.djhtml\\'" . web-mode)
("\\.vue\\'" . web-mode)) ("\\.vue\\'" . web-mode))
:config
(csetq web-mode-markup-indent-offset 2
web-mode-code-indent-offset 2
web-mode-css-indent-offset 2
web-mode-style-padding 0
web-mode-script-padding 0)
:general :general
(phundrak/major-leader-key (phundrak/major-leader-key
:keymaps 'web-mode-map :keymaps 'web-mode-map
@ -7408,11 +7414,9 @@ And finally, here is a formatter for Javascript.
(use-package prettier-js (use-package prettier-js
:defer t :defer t
:straight (:build t) :straight (:build t)
:hook (rjsx-mode . prettier-js-mode) :hook ((rjsx-mode web-mode) . prettier-js-mode)
:hook (web-mode . prettier-js-mode) :config
:custom (csetq prettier-js-args '("--single-quote" "--jsx-single-quote")))
(prettier-js-args '("--single-quote"
"--jsx-single-quote")))
#+end_src #+end_src
***** Typescript ***** Typescript