mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-01 12:17:25 -05:00
js: add typescript-mode and tide
This commit is contained in:
2
Cask
2
Cask
@ -174,6 +174,8 @@
|
||||
(depends-on "tern")
|
||||
(depends-on "unityjs-mode" :git "https://github.com/naruse/EmacsUnityScript")
|
||||
(depends-on "coffee-mode")
|
||||
(depends-on "typescript-mode")
|
||||
(depends-on "tide")
|
||||
(depends-on "company-tern")
|
||||
(depends-on "nodejs-repl")
|
||||
|
||||
|
@ -86,6 +86,28 @@
|
||||
:mode "\\.coffee$"
|
||||
:config (setq-default coffee-indent-like-python-mode t))
|
||||
|
||||
(use-package typescript-mode
|
||||
:mode "\\.ts$")
|
||||
|
||||
(use-package tide
|
||||
:after typescript-mode
|
||||
:config
|
||||
(setq tide-format-options
|
||||
'(:insertSpaceAfterFunctionKeywordForAnonymousFunctions t
|
||||
:placeOpenBraceOnNewLineForFunctions nil))
|
||||
(defun narf|tide-setup ()
|
||||
(tide-setup)
|
||||
(flycheck-mode +1)
|
||||
(eldoc-mode +1))
|
||||
(add-hook 'typescript-mode-hook 'narf|tide-setup)
|
||||
(add-hook! web-mode
|
||||
(when (f-ext? buffer-file-name "tsx")
|
||||
(narf|tide-setup)))
|
||||
|
||||
(map! :map typescript-mode-map
|
||||
:m "gd" 'tide-jump-to-definition
|
||||
(:leader :n "h" 'tide-documentation-at-point)))
|
||||
|
||||
;;
|
||||
(def-project-type! nodejs "node"
|
||||
:modes (web-mode js-mode js2-mode json-mode coffee-mode scss-mode sass-mode less-css-mode)
|
||||
|
Reference in New Issue
Block a user