@@ -19,7 +19,7 @@ My [[https://github.com/raxod502/straight.el][straight.el]] based emacs configur
19
19
- Bootstrap
20
20
21
21
#+begin_src elisp :tangle ./early-init.el
22
- ;;; core-ui.el - *- lexical-binding: t; -*-
22
+ ;; - *- lexical-binding: t -*-
23
23
(setq package-enable-at-startup nil)
24
24
25
25
;;
@@ -1022,18 +1022,44 @@ says on the box without much fuss.
1022
1022
(setq emmet-insert-flash-time 0.001) ; effectively disabling it
1023
1023
(add-hook 'js-jsx-mode-hook #'(lambda ()
1024
1024
(setq-local emmet-expand-jsx-className? t)))
1025
- (add-hook 'ts -tsx-mode-hook #'(lambda ()
1025
+ (add-hook 'typescript -tsx-mode-hook #'(lambda ()
1026
1026
(setq-local emmet-expand-jsx-className? t)))
1027
1027
(add-hook 'web-mode-hook #'(lambda ()
1028
1028
(setq-local emmet-expand-jsx-className? t))))
1029
1029
1030
1030
(use-package typescript-mode
1031
- :mode "\\.tsx ?\\'")
1031
+ :mode "\\.ts ?\\'")
1032
1032
1033
1033
(use-package css-mode
1034
1034
:mode "\\.s?css\\'")
1035
1035
#+end_src
1036
1036
1037
+ - Setup =typescript-tsx-mode= using code I don't fully understand. Copied from
1038
+ [[https://github.com/emacs-typescript/typescript.el/issues/4#issuecomment-873485004][typescript.el#4]]
1039
+
1040
+ #+begin_src elisp
1041
+ (use-package typescript-mode
1042
+ :ensure t
1043
+ :init
1044
+ (define-derived-mode typescript-tsx-mode typescript-mode "tsx")
1045
+ :config
1046
+ (setq typescript-indent-level 2)
1047
+ (add-hook 'typescript-mode #'subword-mode)
1048
+ (add-to-list 'auto-mode-alist '("\\.tsx?\\'" . typescript-tsx-mode)))
1049
+
1050
+ (use-package tree-sitter
1051
+ :ensure t
1052
+ :hook ((typescript-mode . tree-sitter-hl-mode)
1053
+ (typescript-tsx-mode . tree-sitter-hl-mode)))
1054
+
1055
+ (use-package tree-sitter-langs
1056
+ :ensure t
1057
+ :after tree-sitter
1058
+ :config
1059
+ (tree-sitter-require 'tsx)
1060
+ (add-to-list 'tree-sitter-major-mode-language-alist '(typescript-tsx-mode . tsx)))
1061
+ #+end_src
1062
+
1037
1063
*** Rust
1038
1064
1039
1065
#+begin_src elisp
0 commit comments