feat(version-control): correctly format forge-post-mode buffers with prettier-js

forge-post-mode uses temporary files for editing, which means that
prettier can't determine the formatter to use based on the
filename. Hence we need to explicitly pass `--parser markdown` as a CLI
arg to prettier.
This commit is contained in:
2020-10-29 10:39:09 +00:00
parent f8be97ac61
commit f5405690b4

View File

@@ -12,5 +12,18 @@
:defer t
:after magit)
(use-package forge-post
:straight forge
:defer t
:hook
(forge-post-mode . siren-forge-post-mode-setup)
:init
(defun siren-forge-post-mode-setup ()
(setq-local prettier-js-args '("--parser" "markdown"
"--print-width" "80"
"--prose-wrap" "always"))))
(provide 'siren-forge)
;;; siren-forge.el ends here