(require 'json-mode)
(require 'js)
(require 'js2-mode)
-(require 'typescript-mode)
-;; (require 'tide)
(add-to-list 'auto-mode-alist '("\\.js\\'" . js2-mode))
(add-to-list 'interpreter-mode-alist '("node" . js2-mode))
(setq js2-concat-multiline-strings 'eol)
(setq js--declaration-keyword-re "x^") ; declarations should have normal indentation
(setq js-indent-align-list-continuation nil)
-;; (add-hook 'js2-mode-hook #'tide-setup)
(add-hook 'js2-mode-hook #'js2-refactor-mode)
-;; (add-hook 'typescript-mode-hook #'tide-setup)
-(add-hook 'typescript-mode-hook #'js2-refactor-mode)
-
-(defun tide-project-root ()
- (or
- tide-project-root
- (let ((root (or (locate-dominating-file default-directory "tsconfig.json")
- (locate-dominating-file default-directory "jsconfig.json")
- (locate-dominating-file default-directory ".git")
- (locate-dominating-file default-directory "package.json"))))
- (unless root
- (message (tide-join (list "Couldn't locate JavaScript project root folder. Using '" default-directory "' as project root.")))
- (setq root default-directory))
- (let ((full-path (expand-file-name root)))
- (setq tide-project-root full-path)
- full-path))))
(require 'js2-refactor)
(js2r-add-keybindings-with-prefix "C-c C-m")
(setq js2r-always-insert-parens-around-arrow-function-params t)
(setq js2r-prefered-quote-type 2)
-(require 'rjsx-mode)
-(add-to-list 'auto-mode-alist '("\\.tsx\\'" . js2-jsx-mode))
-
-
(require 'ledger-mode nil 'noerror)
(add-to-list 'auto-mode-alist '("\\.ledger\\'" . ledger-mode))
(setq ledger-post-amount-alignment-column 72)