Skip to content

Instantly share code, notes, and snippets.

@qoobaa
Created January 27, 2016 12:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save qoobaa/22c60eeb12ccb42a4563 to your computer and use it in GitHub Desktop.
Save qoobaa/22c60eeb12ccb42a4563 to your computer and use it in GitHub Desktop.
(add-hook 'js2-mode-hook 'qoobaa/js2-mode-setup)
(defun qoobaa/js2-mode-setup ()
(let ((local-eslint (expand-file-name "node_modules/.bin/eslint" (projectile-project-root))))
(when (file-exists-p local-eslint)
(setq flycheck-javascript-eslint-executable local-eslint)
(js2-mode-hide-warnings-and-errors)
(flycheck-mode t)
(flycheck-select-checker 'javascript-eslint))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment