For working with typescript
This commit is contained in:
parent
266baf9d38
commit
93fe1217ae
1 changed files with 47 additions and 0 deletions
47
workflows/typescript-custom.el
Normal file
47
workflows/typescript-custom.el
Normal file
|
|
@ -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 <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
|
||||||
|
;;; 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
|
||||||
Loading…
Add table
Add a link
Reference in a new issue