(comment-or-uncomment-region (region-beginning) (region-end))
(comment-or-uncomment-region (line-beginning-position) (line-end-position)))
(forward-line))
+
+(defun my/use-eslint-from-node-modules ()
+ (let* ((root (locate-dominating-file
+ (or (buffer-file-name) default-directory)
+ "node_modules"))
+ (eslint (and root
+ (expand-file-name "node_modules/.bin/eslint" root))))
+ (when (and eslint (file-executable-p eslint))
+ (setq-local flycheck-javascript-eslint-executable eslint))))
(global-flycheck-mode 1)
(setq-default flycheck-disabled-checkers '(emacs-lisp-checkdoc))
(setq flycheck-emacs-lisp-load-path 'inherit)
+(add-hook 'flycheck-mode-hook #'my/use-eslint-from-node-modules)
(require 'misc)