summaryrefslogtreecommitdiff
path: root/lisp/web.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/web.el')
-rw-r--r--lisp/web.el9
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)