Lazy load flycheck

This commit is contained in:
syl20bnr 2018-06-11 02:07:23 -04:00
parent 095a83896a
commit 19b478efbd
2 changed files with 22 additions and 23 deletions

View File

@ -21,19 +21,30 @@
:defer t
:init
(progn
(spacemacs|add-transient-hook prog-mode-hook
(lambda () (when syntax-checking-enable-by-default
(global-flycheck-mode 1)))
lazy-load-flycheck)
(setq flycheck-standard-error-navigation nil
flycheck-global-modes nil)
;; key bindings
(spacemacs/set-leader-keys
"eb" 'flycheck-buffer
"ec" 'flycheck-clear
"eh" 'flycheck-describe-checker
"el" 'spacemacs/toggle-flycheck-error-list
"eL" 'spacemacs/goto-flycheck-error-list
"es" 'flycheck-select-checker
"eS" 'flycheck-set-checker-executable
"ev" 'flycheck-verify-setup
"ex" 'flycheck-explain-error-at-point)
(spacemacs|add-toggle syntax-checking
:mode flycheck-mode
:documentation "Enable error and syntax checking."
:evil-leader "ts")
:evil-leader "ts"))
:config
(progn
(spacemacs|diminish flycheck-mode "" " s")
(when syntax-checking-enable-by-default
(global-flycheck-mode 1))
;; Custom fringe indicator
(when (and (fboundp 'define-fringe-bitmap)
(not syntax-checking-use-original-bitmaps))
@ -55,7 +66,6 @@
#b00000000
#b00000000
#b00000000)))
(let ((bitmap (if syntax-checking-use-original-bitmaps
'flycheck-fringe-bitmap-double-arrow
'my-flycheck-fringe-indicator)))
@ -83,19 +93,7 @@
:bindings
"RET" 'flycheck-error-list-goto-error
"j" 'flycheck-error-list-next-error
"k" 'flycheck-error-list-previous-error)
;; key bindings
(spacemacs/set-leader-keys
"eb" 'flycheck-buffer
"ec" 'flycheck-clear
"eh" 'flycheck-describe-checker
"el" 'spacemacs/toggle-flycheck-error-list
"eL" 'spacemacs/goto-flycheck-error-list
"es" 'flycheck-select-checker
"eS" 'flycheck-set-checker-executable
"ev" 'flycheck-verify-setup
"ex" 'flycheck-explain-error-at-point))))
"k" 'flycheck-error-list-previous-error))))
(defun syntax-checking/init-flycheck-pos-tip ()
(use-package flycheck-pos-tip

View File

@ -41,8 +41,9 @@
(spacemacs/enable-flycheck 'typescript-mode)
(spacemacs/enable-flycheck 'typescript-tsx-mode)
(with-eval-after-load 'tide
(flycheck-add-mode 'typescript-tide 'typescript-tsx-mode))
(flycheck-add-mode 'typescript-tslint 'typescript-tsx-mode))
(with-eval-after-load 'flycheck
(flycheck-add-mode 'typescript-tide 'typescript-tsx-mode)
(flycheck-add-mode 'typescript-tslint 'typescript-tsx-mode))))
(defun typescript/post-init-lsp-mode ()
(add-hook 'typescript-mode-hook 'lsp-mode))