fix setttings.org

This commit is contained in:
Andre Henriques 2023-03-26 22:43:43 +01:00
parent 675d8f21bb
commit bf742ab74c

View File

@ -374,6 +374,20 @@ Set up ivy
:ensure t :ensure t
:commands lsp-ivy-workspace-symbol) :commands lsp-ivy-workspace-symbol)
#+end_src #+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 ** Flycheck
*** Helper function *** Helper function
#+begin_src emacs-lisp #+begin_src emacs-lisp
@ -472,8 +486,14 @@ Fly check inline (disabled because was getting annoyed)
:ensure t :ensure t
:after (typescript-mode company flycheck) :after (typescript-mode company flycheck)
:hook ((typescript-mode . tide-setup) :hook ((typescript-mode . tide-setup)
(typescript-mode . tide-hl-identifier-mode) (typescript-mode . tide-hl-identifier-mode))
(before-save . tide-format-before-save))) ;;(before-save . tide-format-before-save))
)
(add-to-list 'auto-mode-alist '("\\.tsx?\\'" . typescript-mode)) (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 #+end_src