Support searching node_modules/.bin

Adds a package that allows Emacs to searching through a projects
node_modules executables when resolving a binary like eslint, prettier
etc. This was being hacked together before by relying on explicit paths
to executables. This is a more durable solution.

Also includes some packages related to LSP for Javascript, which I
haven't been able to get working yet.
This commit is contained in:
William Carroll 2018-09-04 14:55:41 -04:00
parent 3dadd97ef3
commit 6ebd90a946
2 changed files with 44 additions and 48 deletions

View file

@ -103,17 +103,6 @@
(evil-window-vsplit)
(find-file "~/.emacs.d/init.el"))
(defun wpc/set-flow-executable ()
(interactive)
(let* ((root (locate-dominating-file buffer-file-name "node_modules/flow-bin"))
(executable (car (file-expand-wildcards
(concat root "node_modules/flow-bin/*osx*/flow")))))
(setq-local company-flow-executable executable)
;; These are not necessary for this package, but a good idea if you use
;; these other packages
(setq-local flow-minor-default-binary executable)
(setq-local flycheck-javascript-flow-executable executable)))
(defun wpc/jump-to-parent-file ()
"Jumps to a React store or component's parent file. Useful for store or index file."
(interactive)