Ensure Emacs prettier hook activates

Problem:
prettier-js waits for rjsx-mode. rjsx-mode only runs on .js files. As such,
the hook that installs prettier-js-mode for *all* of my frontend hooks, which
includes more than just js files, does not install until a javascript file is
opened.

Solution:
Do not conditionally load prettier-js.

Bonus:
Remove the .js mode from rjsx.
This commit is contained in:
William Carroll 2020-03-27 10:59:57 +00:00
parent 0281eb58aa
commit f2ba5aca31

View file

@ -44,7 +44,6 @@
;; JSX highlighting
(use-package rjsx-mode
:mode "\\.js\\'"
:config
(general-unbind rjsx-mode-map "<" ">" "C-d")
(general-nmap
@ -75,7 +74,6 @@
;; JS autoformatting
(use-package prettier-js
:after (rjsx-mode)
:config
(general-add-hook wpc/frontend-hooks #'prettier-js-mode))