fix(typescript) fix ts init process with .tsx files (#15885)

fixes https://github.com/syl20bnr/spacemacs/issues/15217
fixes https://github.com/syl20bnr/spacemacs/issues/15412
This commit is contained in:
lawrsp 2023-01-10 07:14:49 +08:00 committed by GitHub
parent f51fab4baa
commit 43d76ebe42
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -101,7 +101,6 @@
(defun typescript/post-init-web-mode ()
(define-derived-mode typescript-tsx-mode web-mode "TypeScript-tsx")
(add-to-list 'auto-mode-alist '("\\.tsx\\'" . typescript-tsx-mode))
(spacemacs/typescript-mode-init 'typescript-tsx-mode-local-vars-hook)
(spacemacs/typescript-mode-config 'typescript-tsx-mode))
(defun typescript/init-typescript-mode ()
@ -110,7 +109,9 @@
:init
(progn
(spacemacs/typescript-safe-local-variables '(lsp tide))
(spacemacs/typescript-mode-init 'typescript-mode-local-vars-hook))
(spacemacs/typescript-mode-init 'typescript-mode-local-vars-hook)
;; init tsx locals here to get proper order
(spacemacs/typescript-mode-init 'typescript-tsx-mode-local-vars-hook))
:config (spacemacs/typescript-mode-config 'typescript-mode)))
(defun typescript/pre-init-import-js ()