From 93fe1217ae8087d44d73b78b7c40b3fb8051ddf4 Mon Sep 17 00:00:00 2001 From: BirDt_ Date: Fri, 15 May 2026 21:33:06 +0800 Subject: [PATCH] For working with typescript --- workflows/typescript-custom.el | 47 ++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 workflows/typescript-custom.el diff --git a/workflows/typescript-custom.el b/workflows/typescript-custom.el new file mode 100644 index 0000000..cbb0bd8 --- /dev/null +++ b/workflows/typescript-custom.el @@ -0,0 +1,47 @@ +;;; typescript-custom.el --- Customisations for working with typescript -*- lexical-binding: t -*- + +;; This file is not part of GNU Emacs + +;; This program is free software: you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see . + + +;;; Commentary: + +;; commentary + +;;; Code: + +;; More consistent than typescript-ts-mode atm +(use-package typescript-mode + :hook (typescript-mode . eglot-ensure)) + +(use-package tide + :init + (defun setup-tide-mode () + (interactive) + (tide-setup) + (flycheck-mode +1) + (setq flycheck-check-syntax-automatically '(save mode-enabled)) + (eldoc-mode +1) + (tide-hl-identifier-mode +1)) + + ;; formats the buffer before saving + (add-hook 'before-save-hook 'tide-format-before-save) + + ;; For typescript-mode + (add-hook 'typescript-mode-hook #'setup-tide-mode)) + +(provide 'typescript-custom) + +;;; typescript-custom.el ends here