fix(formatting/prettier): use prettier-pnp instead of prettier

As of v3.x prettier can no longer load plugins installed via npm
globally. The prettier-pnp package/binary works around this by acting as
a wrapper with more flexible support for loading plugins.
This commit is contained in:
2024-02-01 23:06:05 +01:00
parent 434d13dd0e
commit 63f6e3fa41

View File

@@ -19,6 +19,11 @@
toml-ts-mode
vue-mode) . siren-prettier-js-mode-enable)
:custom
(prettier-js-command "prettier-pnp")
(prettier-js-args '("--quiet"
"--pnp" "prettier-plugin-toml"))
:preface
(defun siren-prettier-js-mode-enable ()
(prettier-js-mode t))
@@ -26,7 +31,7 @@
:config
(let ((rc (expand-file-name "~/.prettierrc.js")))
(if (file-exists-p rc)
(setq prettier-js-args `("--config" ,rc)))))
(add-to-list 'prettier-js-args `("--config" ,rc)))))
(provide 'siren-prettier-js)
;;; siren-prettier-js.el ends here