]> code.delx.au - dotemacs/blob - lisp/my-flycheck.el
flycheck improvements
[dotemacs] / lisp / my-flycheck.el
1 (require 'flycheck)
2
3 (global-flycheck-mode 1)
4
5 (setq-default flycheck-disabled-checkers '(emacs-lisp-checkdoc))
6
7 (setq flycheck-emacs-lisp-load-path 'inherit)
8
9 (add-hook 'flycheck-mode-hook #'my/use-eslint-from-node-modules)
10
11 (setq flycheck-indication-mode 'right-fringe)
12
13 (define-fringe-bitmap 'flycheck-fringe-bitmap-double-arrow
14 (vector #b00000000
15 #b00000000
16 #b00000000
17 #b00000000
18 #b00000000
19 #b00011001
20 #b00110110
21 #b01101100
22 #b11011000
23 #b01101100
24 #b00110110
25 #b00011001
26 #b00000000
27 #b00000000
28 #b00000000
29 #b00000000
30 #b00000000))
31
32 (defun my/use-eslint-from-node-modules ()
33 (let* ((root (locate-dominating-file
34 (or (buffer-file-name) default-directory)
35 "node_modules"))
36 (eslint (and root
37 (expand-file-name "node_modules/.bin/eslint" root))))
38 (when (and eslint (file-executable-p eslint))
39 (setq-local flycheck-javascript-eslint-executable eslint))))