mirror of
https://github.com/jimeh/.emacs.d.git
synced 2026-02-19 13:46:41 +00:00
fix(formatting): specify parser for prettier-js to avoid errors
Some buffers which use markdown-mode or yaml mode yield errors when using the prettier-js package to format them, as it looks at the file extension by default to figure out what parser to use. Some temporary files that use these modes don't have the correct file extension, so prettier-js yields an error. My manually specifying the correct "--parser" option for each major-mode, this is no longer an issue.
This commit is contained in:
@@ -42,7 +42,8 @@
|
||||
:init
|
||||
(defun siren-markdown-mode-setup ()
|
||||
(setq-local markdown-asymmetric-header t
|
||||
prettier-js-args '("--print-width" "80"
|
||||
prettier-js-args '("--parser" "markdown"
|
||||
"--print-width" "80"
|
||||
"--prose-wrap" "always")
|
||||
whitespace-action nil)
|
||||
|
||||
|
||||
@@ -20,7 +20,8 @@
|
||||
:init
|
||||
(defun siren-yaml-mode-setup ()
|
||||
(run-hooks 'prog-mode-hook)
|
||||
(setq tab-width 2)
|
||||
(setq tab-width 2
|
||||
prettier-js-args '("--parser" "yaml"))
|
||||
(prettier-js-mode)
|
||||
(subword-mode +1)))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user