aboutsummaryrefslogtreecommitdiffstats
path: root/lua
diff options
context:
space:
mode:
authorTrent Nicholson <39316919+NICHTJ3@users.noreply.github.com>2021-10-19 23:55:37 +1300
committerGitHub <noreply@github.com>2021-10-19 12:55:37 +0200
commit49ca5339215fa9d19722d5340028461c239a58b1 (patch)
treeef309d34f2dde038fb13b4b71b9f5aaf9c886e08 /lua
parentFix the path for denols (#180) (diff)
downloadmason-49ca5339215fa9d19722d5340028461c239a58b1.tar
mason-49ca5339215fa9d19722d5340028461c239a58b1.tar.gz
mason-49ca5339215fa9d19722d5340028461c239a58b1.tar.bz2
mason-49ca5339215fa9d19722d5340028461c239a58b1.tar.lz
mason-49ca5339215fa9d19722d5340028461c239a58b1.tar.xz
mason-49ca5339215fa9d19722d5340028461c239a58b1.tar.zst
mason-49ca5339215fa9d19722d5340028461c239a58b1.zip
Eslint doc for how to resolve eslint in yarn2 repo's (#163)
Diffstat (limited to 'lua')
-rw-r--r--lua/nvim-lsp-installer/servers/eslint/README.md20
1 files changed, 20 insertions, 0 deletions
diff --git a/lua/nvim-lsp-installer/servers/eslint/README.md b/lua/nvim-lsp-installer/servers/eslint/README.md
index 557e986b..5feebfda 100644
--- a/lua/nvim-lsp-installer/servers/eslint/README.md
+++ b/lua/nvim-lsp-installer/servers/eslint/README.md
@@ -36,3 +36,23 @@ This will make `eslint` respond to formatting requests, for example when trigger
- `:lua vim.lsp.buf.formatting()`
- `:lua vim.lsp.buf.formatting_seq_sync()`
- `:lua vim.lsp.buf.formatting_sync()`
+
+## Eslint in projects that use pnp
+
+To allow the `eslint` server to resolve eslint and eslint plugins in a project that uses yarn 2/pnp, you need to manually change the
+command used to run the server. This is done when setting up the LSP server, like so:
+
+```lua
+lsp_installer.on_server_ready(function (server)
+ local opts = {
+ on_attach = common_on_attach,
+ }
+
+ if server.name == "eslint" then
+ local default_opts = server:get_default_options()
+ opts.cmd = vim.list_extend({"yarn", "node"}, default_opts.cmd)
+ end
+
+ server:setup(opts)
+end)
+```