Javascript and Typescript support for lsp-mode using javascript-typescript-langserver.
Clone this repository and lsp-mode to suitable paths, and add them to your load path:
(add-to-list 'load-path "<path to lsp-mode>")
(add-to-list 'load-path "<path to lsp-javascript>")
Install the package lsp-javascript-typescript
(require 'lsp-javascript-typescript)
(add-hook 'js-mode-hook #'lsp-javascript-typescript-enable)
(add-hook 'typescript-mode-hook #'lsp-javascript-typescript-enable) ;; for typescript support
(add-hook 'js3-mode-hook #'lsp-javascript-typescript-enable) ;; for js3-mode support
(add-hook 'rjsx-mode #'lsp-javascript-typescript-enable) ;; for rjsx-mode support
You also need javascript-typescript-langserver installed and on your PATH.
npm i -g javascript-typescript-langserver
(sudo
may be necessary depending on how you have
npm setup)