I'm trying to setup a lint for javascript files.
Here's the relevant setup I have.
(use-package
js2-mode
:ensure t
:init
(progn
(add-to-list 'auto-mode-alist '("\\.js?\\'" . js2-jsx-mode))
)
)
(use-package
flycheck
:ensure t
:init
(progn
(add-hook 'after-init-hook #'global-flycheck-mode)
(setq flycheck-highlighting-mode 'lines)
;; https://github.com/mooz/js2-mode/issues/292
(defun setup-js2-mode ()
(flycheck-select-checker 'javascript-eslint)
(flycheck-mode))
(add-hook 'js2-mode-hook #'setup-js2-mode)
(add-hook 'js2-jsx-mode-hook #'setup-js2-mode)
)
)
also I know emacs can find eslint
M-: (executable-find "eslint")
"/home/eugenekim/.nvm/versions/node/v6.4.0/bin/eslint"
But I get no errors with flycheck-list-errors
when I deliverately make errors on *.js files
Also I found the following weird. (not sure relevant)
M-x flycheck-select-checker (enter) javascript-eslint
Can’t use syntax checker javascript-eslint in this buffer