Automatically enable prettier when .prettierrc is present at git root
This commit is contained in:
parent
dd118646d1
commit
fc32bfa4bf
@ -898,6 +898,14 @@
|
|||||||
:config
|
:config
|
||||||
(company-auctex-init))
|
(company-auctex-init))
|
||||||
|
|
||||||
|
(use-package prettier-js
|
||||||
|
:hook ((js2-mode typescript-mode web-mode) . prettier-js-mode-maybe)
|
||||||
|
:init
|
||||||
|
(defun prettier-js-mode-maybe ()
|
||||||
|
(interactive)
|
||||||
|
(when (file-exists-p (concat (magit-toplevel) ".prettierrc"))
|
||||||
|
(prettier-js-mode t))))
|
||||||
|
|
||||||
;;; Local Variables
|
;;; Local Variables
|
||||||
(add-to-list 'safe-local-eval-forms '(outline-hide-body))
|
(add-to-list 'safe-local-eval-forms '(outline-hide-body))
|
||||||
;; Local Variables:
|
;; Local Variables:
|
||||||
|
Loading…
Reference in New Issue
Block a user