I'm trying to setup a lint for javascript files.

Here's the relevant setup I have.

  :ensure t

    (add-to-list 'auto-mode-alist '("\\.js?\\'" . js2-jsx-mode))

  :ensure t
    (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)

    (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")

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
  • 1
    Did you find an answer to this? I'm guessing you need to have an esling configuration file in the directory the js file is in or something similar to configure eslint, but not yet found any details on this?
    – Tim X
    Sep 17, 2017 at 5:29


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.