dotfiles/.config/nvim/lua/plugins/null-ls.lua

45 lines
1 KiB
Lua
Raw Normal View History

2022-12-27 18:36:38 +01:00
local M = {
"jose-elias-alvarez/null-ls.nvim",
dependencies = { "nvim-lua/plenary.nvim" },
}
function M.config()
local null_ls = require("null-ls")
local builtins = require("null-ls.builtins")
null_ls.setup({
sources = {
2023-02-14 13:21:14 +01:00
builtins.code_actions.eslint_d,
2023-03-08 11:12:03 +01:00
builtins.completion.spell,
2022-12-27 18:36:38 +01:00
builtins.diagnostics.buf.with({
args = { "lint", "--disable-symlinks", "--path", "$FILENAME" },
cwd = function()
local file_dir = vim.fn.expand("%:p:h") .. ";"
local buf_yaml = vim.fn.findfile("buf.yaml", file_dir)
if buf_yaml then
return vim.fn.fnamemodify(buf_yaml, ":h")
end
end,
}),
builtins.diagnostics.buildifier,
builtins.diagnostics.cue_fmt,
2023-02-14 13:21:14 +01:00
builtins.diagnostics.eslint_d,
2023-03-08 11:12:03 +01:00
builtins.diagnostics.golangci_lint,
builtins.formatting.black,
builtins.formatting.buf,
builtins.formatting.buildifier,
builtins.formatting.cue_fmt,
builtins.formatting.prettierd,
builtins.formatting.shfmt,
builtins.formatting.sqlfluff,
builtins.formatting.stylua,
2022-12-27 18:36:38 +01:00
},
debug = true,
})
end
return M