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