-
```lisp ;; we choose this name instead of tsx-mode so that eglot can automatically figure out language for server ;; see https://github.com/joaotavora/eglot/issues/624 and https://github.com/joaotavora/eglot#handling-quirky-servers (define-derived-mode typescriptreact-mode typescript-mode "TypeScript TSX") (add-to-list 'auto-mode-alist '("\.tsx\'" . typescriptreact-mode))
-
SaaSHub
SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives
-
;; use our derived mode for tsx files (add-to-list 'auto-mode-alist '("\.tsx\'" . typescriptreact-mode)) ;; by default, typescript-mode is mapped to the treesitter typescript parser ;; use our derived mode to map .tsx -> typescriptreact-mode -> treesitter tsx (add-to-list 'tree-sitter-major-mode-language-alist '(typescriptreact-mode . tsx)) ;; https://github.com/orzechowskid/tsi.el/ ;; great tree-sitter-based indentation for typescript/tsx, css, json (quelpa '(tsi :fetcher github :repo "orzechowskid/tsi.el")) (add-hook 'typescript-mode-hook (lambda () (tsi-typescript-mode 1)))) ```
-
(use-package tree-sitter :ensure t :config (global-tree-sitter-mode) (add-hook 'tree-sitter-after-on-hook #'tree-sitter-hl-mode) ;; by default, typescript-mode is mapped to the treesitter typescript parser ;; use our derived mode to map .tsx -> typescriptreact-mode -> treesitter tsx (add-to-list 'tree-sitter-major-mode-language-alist '(typescriptreact-mode . tsx)) ;; if you want to look into better tsx and ts intendation support, consider ;; https://github.com/orzechowskid/tsx-mode.el ;; https://github.com/orzechowskid/tsi.el