I am using prettier-js-mode which is great and here is my configuration:
(use-package prettier-js
:commands (prettier-js-mode prettier)
:init (add-hook 'js2-mode-hook 'prettier-js-mode)
:bind (:map js2-mode-map ("M-q" . prettier))
:config
(setq prettier-target-mode "js2-mode")
(setq prettier-js-args '(
"--trailing-comma" "all"
"--bracket-spacing" "false")))
At the moment I have to M-x
and select prettier-js
from the meta menu.
How could I run prettier-js
after a save happens?