LoginSignup
5
5

More than 5 years have passed since last update.

Emacsでtssとflycheckを使う

Posted at

tssはemacsでtypescriptを編集する場合にauto-completeとflymakeを補助するパッケージ
他の言語でflymakeの代わりにflycheckを利用しているのでtypescriptでも同じようにしたかった
typescriptのflycheckにはflycheck-typescript-tslintを使っている

(require 'typescript)
(add-to-list 'auto-mode-alist '("\\.ts\\'" . typescript-mode))

(require 'tss)
(setq tss-popup-help-key "C-:")
(setq tss-jump-to-definition-key "C->")
(setq tss-implement-definition-key "C-c i")

;; (tss-config-default)は使わない
;; 中で(add-hook 'after-save-hook 'tss-run-flymake t)されているから
(defun typescript-setup ()
  (setq typescript-indent-level 2)
  (flycheck-mode t)
  (flycheck-typescript-tslint-setup)
  (tss-setup-current-buffer))

(add-hook 'typescript-mode-hook 'typescript-setup)
(add-hook 'kill-buffer-hook 'tss--delete-process t)

5
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
5