From bf742ab74c43103b67aac640a631d9a21e8e0b6b Mon Sep 17 00:00:00 2001 From: Andre Henriques Date: Sun, 26 Mar 2023 22:43:43 +0100 Subject: [PATCH] fix setttings.org --- settings.org | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/settings.org b/settings.org index f470623..96dd545 100644 --- a/settings.org +++ b/settings.org @@ -374,6 +374,20 @@ Set up ivy :ensure t :commands lsp-ivy-workspace-symbol) #+end_src +*** Flycheck custom checkers +#+begin_src emacs-lisp + (defvar-local my/flycheck-local-cache nil) + (defun my/flycheck-checker-get (fn checker property) + (or (alist-get property (alist-get checker my/flycheck-local-cache)) + (funcall fn checker property))) + + (advice-add 'flycheck-checker-get :around 'my/flycheck-checker-get) + + (add-hook 'lsp-managed-mode-hook + (lambda () + (when (derived-mode-p 'typescript-mode) + (setq my/flycheck-local-cache '((lsp . ((next-checkers . (javascript-eslint))))))))) +#+end_src ** Flycheck *** Helper function #+begin_src emacs-lisp @@ -472,8 +486,14 @@ Fly check inline (disabled because was getting annoyed) :ensure t :after (typescript-mode company flycheck) :hook ((typescript-mode . tide-setup) - (typescript-mode . tide-hl-identifier-mode) - (before-save . tide-format-before-save))) + (typescript-mode . tide-hl-identifier-mode)) + ;;(before-save . tide-format-before-save)) + ) (add-to-list 'auto-mode-alist '("\\.tsx?\\'" . typescript-mode)) + + (eval-after-load "tsx" + '(progn + (message "setups eslint tide") + (flycheck-select-checker 'javascript-eslint))) #+end_src