nvim/lua/cosmic/lsp/providers/eslint.lua
2024-06-05 09:37:04 -07:00

19 lines
557 B
Lua

local default_on_attach = require('cosmic.lsp.providers.defaults').on_attach
return {
on_attach = function(client, bufnr)
default_on_attach(client, bufnr)
vim.api.nvim_create_autocmd('BufWritePre', {
buffer = bufnr,
command = 'EslintFixAll',
})
end,
settings = {
-- helps eslint find the eslintrc when it's placed in a subfolder instead of the cwd root
workingDirectories = { mode = 'auto' },
-- allows to use flat config format
--[[ experimental = { ]]
--[[ useFlatConfig = true, ]]
--[[ }, ]]
},
}