-
-
Notifications
You must be signed in to change notification settings - Fork 890
LSP ESlint integration
Kuba Orlik edited this page May 20, 2021
·
6 revisions
- Download the latest version of VScode ESlint from VScode marketplace and unzip it(alternatively, clone and build https://github.com/Microsoft/vscode-eslint). Make sure to use verson
2.1.14
and thatlsp-eslint-server-command
points to the correct location1 .
(setq lsp-eslint-server-command
'("node"
"/home/USER/.vscode/extensions/dbaeumer.vscode-eslint-2.0.11/server/out/eslintServer.js"
"--stdio"))
- Install
eslint
either locally globally via:
npm install -g eslint
- Invoke
M-x lsp
in html, js, ts buffers. - Enjoy
1: Tilde expansion won't work as expected resulting in the string being appended to your project's root directory. eg: /usr/local/src/my-app/\~/.vscode/extensions/...
if you update the vscode extension regularly you could use something like (setq lsp-eslint-server-command `("node" ,(expand-file-name (car (last (file-expand-wildcards "~/.vscode/extensions/dbaeumer.vscode-eslint-*/server/out/eslintServer.js")))) "--stdio"))