How do I configure which languages eslint is used for? #1303
Answered
by
williamboman
NullVoxPopuli
asked this question in
Q&A
-
I see that here we have but the settings keys have dots in them -- how does this work in lua, since keys aren't allowed to have dots, as strings are not valid object keys? |
Beta Was this translation helpful? Give feedback.
Answered by
williamboman
May 16, 2023
Replies: 1 comment 2 replies
-
update, the syntax I was looking for was for _, serverName in ipairs(servers) do
local server = lsp[serverName]
if (server) then
-- ...
elseif (serverName == 'eslint') then
server.setup({
settings = {
["eslint.probe"] = { "javascript", "typescript", "typescript.glimmer", "javascript.glimmer" },
["eslint.validate"] = { "javascript", "typescript", "typescript.glimmer", "javascript.glimmer" },
},
on_attach = function(client, bufnr)
vim.api.nvim_create_autocmd("BufWritePre", {
buffer = bufnr,
command = "EslintFixAll",
})
end,
})
|
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I believe those settings are VSCode-specific. If you don't want to spawn the eslint language server for certain filetypes you can override the default filetypes when setting up the server: