;;; init-flycheck.el --- Initialize Flycheck -*- lexical-binding: t -*- ;;; Commentary: ;; https://www.flycheck.org/ ;; https://github.com/flycheck/flycheck ;; ;; I use Flycheck for linting all code except Elisp. I use Flymake for Elisp ;; because it produces more warnings than Flycheck. ;;; Code: (unless (package-installed-p 'flycheck) (package-install 'flycheck)) (require 'flycheck) (setq flycheck-check-syntax-automatically '(mode-enabled save)) (setq flycheck-emacs-lisp-load-path 'inherit) (add-hook 'css-mode-hook (defun my-flycheck-css-mode-hook-settings () (setq flycheck-stylelintrc "stylelint.config.js"))) (add-hook 'sh-mode-hook (defun my-flycheck-sh-mode-hook-settings () (setq-default flycheck-checker 'sh-shellcheck) (flycheck-mode 1))) (provide 'init-flycheck) ;;; init-flycheck.el ends here