45 lines
1.0 KiB
Lua
45 lines
1.0 KiB
Lua
-- Deno Support
|
|
|
|
return {
|
|
-- Mason
|
|
{
|
|
"mason-org/mason.nvim",
|
|
opts = function(_, opts)
|
|
opts.ensure_installed = opts.ensure_installed or {}
|
|
vim.list_extend(opts.ensure_installed, { "deno" })
|
|
end,
|
|
},
|
|
|
|
-- LSP Config
|
|
{
|
|
"neovim/nvim-lspconfig",
|
|
opts = {
|
|
servers = {
|
|
denols = {
|
|
root_markers = { "deno.json", "deno.jsonc" },
|
|
},
|
|
},
|
|
},
|
|
},
|
|
|
|
-- Conform
|
|
{
|
|
"stevearc/conform.nvim",
|
|
opts = {
|
|
formatters_by_ft = {
|
|
javascript = { "deno_fmt", "prettier", stop_after_first = true },
|
|
javascriptreact = { "deno_fmt", "prettier", stop_after_first = true },
|
|
typescript = { "deno_fmt", "prettier", stop_after_first = true },
|
|
typescriptreact = { "deno_fmt", "prettier", stop_after_first = true },
|
|
},
|
|
formatters = {
|
|
deno_fmt = {
|
|
condition = function(ctx)
|
|
return vim.fs.find({ "deno.json", "deno.jsonc" }, { path = ctx.filename, upward = true })[1] ~= nil
|
|
end,
|
|
},
|
|
},
|
|
},
|
|
},
|
|
}
|