Skip to content

Commit fae7edd

Browse files
authored
Add suggestion to make Eglot run automatically
At the current time, Eglot requires that the user `M-x eglot' to start linting their code. This step can be avoided by including `(eglot-ensure)' in the `my-eglot-quicklintjs-setup' function. This is an improvement because it makes quick-lint-js integration with eglot plug and play, avoiding unnecessary steps.
1 parent 1393e47 commit fae7edd

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

plugin/emacs/README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,10 @@ Usage example in your [Emacs initialization] file.
5151
5252
;; Remove the time to wait after last change before automatically checking
5353
;; buffer. The default is 0.5 (500ms)
54-
(setq-local eglot-send-changes-idle-time 0))
54+
(setq-local eglot-send-changes-idle-time 0)
55+
56+
;; Optional: Make Eglot run automatically when `js-mode' is loaded
57+
(eglot-ensure))
5558
(add-hook 'js-mode-hook #'my-eglot-quicklintjs-setup)
5659
```
5760

plugin/emacs/eglot-quicklintjs.el

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@
1313
;;
1414
;; ;; Remove the time to wait after last change before automatically checking
1515
;; ;; buffer. The default is 0.5 (500ms)
16-
;; (setq-local eglot-send-changes-idle-time 0))
16+
;; (setq-local eglot-send-changes-idle-time 0)
17+
;;
18+
;; ;; Optional: Make Eglot run automatically when `js-mode' is loaded
19+
;; (eglot-ensure))
1720
;; (add-hook 'js-mode-hook #'my-eglot-quicklintjs-setup)
1821

1922
;;; Code:

website/public/install/emacs/configure/index.ejs.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,10 @@ <h3 id="eglot">Eglot</h3>
6161
"Configure eglot-quicklintjs for better experience."
6262
;; Optional: Remove the time to wait after last change before automatically
6363
;; checking buffer. The default is 0.5 (500ms)
64-
(setq-local eglot-send-changes-idle-time 0))
64+
(setq-local eglot-send-changes-idle-time 0)
65+
66+
;; Optional: Make Eglot run automatically when `js-mode' is loaded
67+
(eglot-ensure))
6568
(add-hook 'js-mode-hook #'my-eglot-quicklintjs-setup)</code></pre>
6669

6770
<h3 id="flycheck">Flycheck</h3>

0 commit comments

Comments
 (0)