Commit 55d8b1ba authored by marc0s's avatar marc0s

Use locally installed eslint

parent be32ea79
......@@ -150,6 +150,17 @@ work here..."
(side . bottom)
(reusable-frames . visible)
(window-height . 0.2)))
;; Look up nearest node_modules/eslint installation and use it
(defun my/use-eslint-from-node-modules ()
(let* ((root (locate-dominating-file
(or (buffer-file-name) default-directory)
(eslint (and root
(expand-file-name "node_modules/eslint/bin/eslint.js"
(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)
(use-package flycheck-pos-tip
:ensure t
......@@ -212,10 +223,7 @@ work here..."
(setq fill-column 100))
(defun marc0s/js2-flycheck ()
"Configure flycheck with eslint."
(add-to-list 'exec-path "/home/marcos/.nvm/v4.6.1/bin")
(flycheck-mode t)
(when (executable-find "eslint")
(flycheck-select-checker 'javascript-eslint)))
(flycheck-mode t))
(defun marc0s/mdn-search (searchString)
"Open a browser on the MDN page for SEARCHSTRING."
(interactive (list (read-string "Search: " (thing-at-point 'symbol))))
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment