diff --git a/lua/plugins/deno.lua b/lua/plugins/deno.lua new file mode 100644 index 0000000..876ce86 --- /dev/null +++ b/lua/plugins/deno.lua @@ -0,0 +1,44 @@ +-- 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, + }, + }, + }, + }, +}