summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAlan Pearce2017-09-06 16:43:17 +0200
committerAlan Pearce2017-09-06 16:43:17 +0200
commite88dc6c07d33e734c8059dfe4e01a8556ab8a5f8 (patch)
treec31a179e5b4bd9c42684c353db6faec57c79b693
parent7c4e5b86ca9b1712882991d7e3f777db99f01356 (diff)
downloaddotfiles-e88dc6c07d33e734c8059dfe4e01a8556ab8a5f8.tar.lz
dotfiles-e88dc6c07d33e734c8059dfe4e01a8556ab8a5f8.tar.zst
dotfiles-e88dc6c07d33e734c8059dfe4e01a8556ab8a5f8.zip
Emacs: hook up `standard` and `eslint` if available
-rw-r--r--emacs/.emacs.d/main.el7
1 files changed, 6 insertions, 1 deletions
diff --git a/emacs/.emacs.d/main.el b/emacs/.emacs.d/main.el
index bb90258..2f7bf53 100644
--- a/emacs/.emacs.d/main.el
+++ b/emacs/.emacs.d/main.el
@@ -2296,7 +2296,12 @@ With prefix TO-CURRENT-BUFFER, insert command output into buffer."
 ;; #+BEGIN_SRC emacs-lisp
 (use-package add-node-modules-path
   :config (progn
-            (add-hook 'js2-mode-hook #'add-node-modules-path)))
+            (define-hook-helper js2-mode ()
+              (add-node-modules-path)
+              (when (executable-find "eslint")
+                (setq flycheck-javascript-eslint-executable "eslint"))
+              (when (executable-find "standard")
+                (setq flycheck-javascript-standard-executable "standard")))))
 ;; #+END_SRC
 
 ;; ***** Flow