From f2ba5aca310ebc7c832e3ec5a41bc70a148d5ed6 Mon Sep 17 00:00:00 2001 From: William Carroll Date: Fri, 27 Mar 2020 10:59:57 +0000 Subject: [PATCH] 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. --- emacs/.emacs.d/wpc/wpc-javascript.el | 2 -- 1 file changed, 2 deletions(-) diff --git a/emacs/.emacs.d/wpc/wpc-javascript.el b/emacs/.emacs.d/wpc/wpc-javascript.el index 3de9fff3a..279b374e3 100644 --- a/emacs/.emacs.d/wpc/wpc-javascript.el +++ b/emacs/.emacs.d/wpc/wpc-javascript.el @@ -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))