Last active
November 9, 2016 04:40
-
-
Save jlindsey/213b8eacd6b418f96e8dafa29c6d60f6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Put in dotspacemacs/user-config | |
(defun my/use-eslint-from-node-modules () | |
(let* ((root (locate-dominating-file | |
(or (buffer-file-name) default-directory) | |
(lambda (dir) (file-executable-p | |
(expand-file-name "node_modules/.bin/eslint" | |
dir))))) | |
(eslint (and root | |
(expand-file-name "node_modules/.bin/eslint" | |
root)))) | |
(when (and eslint (file-executable-p eslint)) | |
(setq-local flycheck-javascript-eslint-executable eslint)))) | |
(add-hook 'flycheck-mode-hook #'my/use-eslint-from-node-modules) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment