(require 'flycheck)
(add-hook 'js2-mode-hook
          (lambda () (flycheck-mode t)))

Used this, to setup flycheck for javascript development. However, i noticed config changes in .jshintrc is not considered at all for error highlighting (setting asi as true to suppress missing semicolons is one such case.) Later, i saw that js2-mode has inbuilt support for error highlighting. So, what set of rules js2-mode and is it as customizable as flycheck-jshint?

2 Answers 2


js2-mode does not use jshint, it will do the syntax check in elisp.


The default checker for js2-mode is jshint.

You don't have to use a lambda function to enable flycheck-mode.

(add-hook 'js2-mode-hook 'flycheck-mode)
(setq flycheck-jshintrc "~/.emacs.d/.jshintrc")

or add your own path to the .jshintrc file.

Later edit: To verify your flycheck setup for a specific buffer, C-c ! v or M-x flycheck-verify-setup.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.