 
 (add-hook 'typescript-mode-hook 'flycheck-mode)
 (add-hook 'typescript-mode-hook
+          (lambda ()
+            (add-hook 'after-save-hook #'tslint-fix-file-and-revert nil 'make-it-local)))
+
+(add-hook 'web-mode-hook
           (lambda ()
             (add-hook 'after-save-hook #'tslint-fix-file-and-revert nil 'make-it-local)))
 

;; aligns annotation to the right hand side
(setq company-tooltip-align-annotations t)

;; formats the buffer before saving
(add-hook 'before-save-hook 'tide-format-before-save)

(add-hook 'typescript-mode-hook #'setup-tide-mode)

(add-hook 'before-save-hook 'delete-trailing-whitespace)

                (or (buffer-file-name) default-directory)
                "node_modules"))
         (tslint (and root
                      (expand-file-name "node_modules/tslint/bin/tslint"
                                        root)))
         (tslint-config (and root
                      (expand-file-name "tsconfig.json"
                                        root)))
         (prettier (and root
                      (expand-file-name "node_modules/prettier/bin-prettier.js"
                                        root))))
    (when (and (and tslint (file-executable-p tslint)) (and prettier (file-executable-p prettier)))
      (shell-command (concat prettier " --parser typescript --write " (buffer-file-name) " && " tslint " --out /dev/null --fix " (buffer-file-name))))))

(defun tslint-fix-file-and-revert ()
  (interactive)
