apheleia: Check prettier config for all prettier variants

This commit is contained in:
Adam Goldsmith 2023-05-04 20:37:02 -04:00
parent ac4cd5a3f0
commit 12d52690d4

View File

@ -1075,7 +1075,7 @@
(cond (cond
((member 'black formatters) (apheleia--pyproject-contains-section "tool.black")) ((member 'black formatters) (apheleia--pyproject-contains-section "tool.black"))
((member 'djlint formatters) (apheleia--pyproject-contains-section "tool.djlint")) ((member 'djlint formatters) (apheleia--pyproject-contains-section "tool.djlint"))
((member 'prettier formatters) ((seq-some (lambda (f) (string-prefix-p "prettier" (symbol-name f))) formatters)
(when (= 0 (call-process "prettier" nil nil nil "--find-config-path" (buffer-file-name))) (when (= 0 (call-process "prettier" nil nil nil "--find-config-path" (buffer-file-name)))
(let* ((config-file (shell-command-to-string (concat "prettier --find-config-path " (buffer-file-name)))) (let* ((config-file (shell-command-to-string (concat "prettier --find-config-path " (buffer-file-name))))
(default-directory (file-name-directory (expand-file-name config-file))) (default-directory (file-name-directory (expand-file-name config-file)))