|
|
@ -1111,26 +1111,42 @@ Default completion is C-j |
|
|
|
*** JavaScript |
|
|
|
|
|
|
|
npm install -g typescript-language-server typescript |
|
|
|
maybe only typescript? |
|
|
|
|
|
|
|
#+begin_src emacs-lisp |
|
|
|
(use-package rjsx-mode |
|
|
|
:ensure t |
|
|
|
:mode ("\\.js\\'" |
|
|
|
"\\.jsx'") |
|
|
|
:config |
|
|
|
(setq js2-mode-show-parse-errors nil |
|
|
|
js2-mode-show-strict-warnings nil |
|
|
|
js2-basic-offset 2 |
|
|
|
js-indent-level 2) |
|
|
|
(setq-local flycheck-disabled-checkers (cl-union flycheck-disable-checkers |
|
|
|
'(javascript-jshint)))) ; jshint doesn"t work for JSX |
|
|
|
|
|
|
|
(use-package add-node-modules-path |
|
|
|
"\\.jsx'")) |
|
|
|
; :config |
|
|
|
; (setq js2-mode-show-parse-errors nil |
|
|
|
; js2-mode-show-strict-warnings nil |
|
|
|
; js2-basic-offset 2 |
|
|
|
; js-indent-level 2) |
|
|
|
; (setq-local flycheck-disabled-checkers (cl-union flycheck-disable-checkers |
|
|
|
; '(javascript-jshint)))) ; jshint doesn"t work for JSX |
|
|
|
|
|
|
|
;(use-package add-node-modules-path |
|
|
|
; :ensure t |
|
|
|
; :defer t |
|
|
|
; :hook (((js2-mode rsjx-mode) . add-node-modules-path))) |
|
|
|
|
|
|
|
(use-package tide |
|
|
|
:ensure t |
|
|
|
:defer t |
|
|
|
:hook (((js2-mode rsjx-mode) . add-node-modules-path))) |
|
|
|
|
|
|
|
:after (rjsx-mode company flycheck) |
|
|
|
:hook (rjsx-mode . setup-tide-mode) |
|
|
|
:config |
|
|
|
(defun setup-tide-mode () |
|
|
|
"Setup function for tide." |
|
|
|
(interactive) |
|
|
|
(tide-setup) |
|
|
|
(flycheck-mode t) |
|
|
|
(setq flycheck-check-synta-automatically '(save mode-enabled)) |
|
|
|
(tide-hl-identifier-mode t))) |
|
|
|
|
|
|
|
(use-package prettier-js |
|
|
|
:ensure t |
|
|
|
:after (rjsx-mode) |
|
|
|
:defer t |
|
|
|
:diminish prettier-js-mode |
|
|
|
:hook (((js2-mode rsjx-mode) . prettier-js-mode))) |
|
|
|