diff options
author | Matthew Kosarek <matthew.kosarek@vention.cc> | 2022-12-30 09:05:12 -0500 |
---|---|---|
committer | Matthew Kosarek <matthew.kosarek@vention.cc> | 2022-12-30 09:05:12 -0500 |
commit | ffe416014baa2cdd6afb7e6976b81dea372ba1be (patch) | |
tree | a43e2806d9e7b037e857571c6574184f96eb1426 /lisp/web.el | |
parent | a652f92adaa10f53e1b66d6aefd2daab41fa3231 (diff) |
Improvements to web mode and removing global flycheck
Diffstat (limited to 'lisp/web.el')
-rw-r--r-- | lisp/web.el | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lisp/web.el b/lisp/web.el index e7af0d4..eece1e0 100644 --- a/lisp/web.el +++ b/lisp/web.el @@ -30,7 +30,7 @@ ;; TypeScript (add-to-list 'auto-mode-alist '("\\.tsx\\'" . web-mode)) -;; Eslint through Flycheck. + (require 'flycheck) (setq-default flycheck-disabled-checkers (append flycheck-disabled-checkers @@ -40,8 +40,8 @@ '(json-jsonlist))) (flycheck-add-mode 'javascript-eslint 'js-mode) (flycheck-add-mode 'typescript-tslint 'typescript-mode) -; use local eslint from node_modules before global -; http://emacs.stackexchange.com/questions/21205/flycheck-with-file-relative-eslint-executable +(add-hook 'js-mode-hook 'flycheck-mode) +(add-hook 'typescript-mode-hook 'flycheck-mode) (defun my-use-eslint-from-node-modules () "Use eslint from local node_modules instead of globally." (let* ((root (locate-dominating-file @@ -54,6 +54,9 @@ (setq-local flycheck-javascript-eslint-executable eslint)))) (add-hook 'flycheck-mode-hook #'my-use-eslint-from-node-modules) +; use local eslint from node_modules before global +; http://emacs.stackexchange.com/questions/21205/flycheck-with-file-relative-eslint-executable + ;; Package management (require 'eglot) (add-hook 'js-mode-hook 'eglot-ensure) |