Skip to content

Commit

Permalink
Merge pull request #182 from jdufresne/tsx
Browse files Browse the repository at this point in the history
Add .tsx to auto-mode-alist
  • Loading branch information
josteink authored Jan 16, 2023
2 parents 4e10fd7 + 7675bab commit 4fcb459
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions typescript-mode-general-tests.el
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@
(indent-region (point-min) (point-max) nil)
(untabify (point-min) (point-max)))

(ert-deftest auto-mode-alist-ts ()
(find-file (make-temp-file load-file-name nil ".ts"))
(should (string-equal "typescript-mode" major-mode)))

(ert-deftest auto-mode-alist-tsx ()
(find-file (make-temp-file load-file-name nil ".tsx"))
(should (string-equal "typescript-mode" major-mode)))

(ert-deftest indentation-reference-document-is-reflowed-correctly ()
(with-temp-buffer
(insert-file-contents "test-files/indentation-reference-document.ts")
Expand Down
2 changes: 1 addition & 1 deletion typescript-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -3119,7 +3119,7 @@ Key bindings:
(folding-add-to-marks-list 'typescript-mode "// {{{" "// }}}" )))

;;;###autoload
(add-to-list 'auto-mode-alist '("\\.ts\\'" . typescript-mode))
(add-to-list 'auto-mode-alist '("\\.tsx?\\'" . typescript-mode))

(provide 'typescript-mode)

Expand Down

0 comments on commit 4fcb459

Please sign in to comment.