feat(neovim): drop prettierd in favor of deno fmt

This commit is contained in:
Alexandre Cavalheiro 2024-10-21 14:59:17 -03:00
parent 753913e67d
commit bc5635c1f5
Signed by: wizardlink
GPG key ID: A5767B54367CFBDF
2 changed files with 32 additions and 3 deletions

View file

@ -74,7 +74,6 @@ in
# Markdown
markdownlint-cli
marksman
prettierd
# Nix
nixd
@ -85,7 +84,8 @@ in
python312Packages.flake8
ruff
# TypeScript
# TypeScript/JavaScript
deno
typescript-language-server
# Rust

View file

@ -9,6 +9,35 @@ return {
opts = function(_, config)
-- config variable is the default configuration table for the setup function call
local null_ls = require("null-ls")
local helpers = require("null-ls.helpers")
local deno_fmt = helpers.make_builtin({
name = "deno_fmt",
filetypes = {
"angular",
"astro",
"css",
"html",
"javascript",
"json",
"jsonc",
"less",
"markdown",
"sass",
"scss",
"svelte",
"typescript",
"vue",
"yaml",
},
method = { null_ls.methods.FORMATTING },
generator_opts = {
command = "deno",
args = { "fmt", "--unstable-component", "-" },
to_stdin = true,
},
factory = helpers.formatter_factory,
})
-- Check supported formatters and linters
-- https://github.com/nvimtools/none-ls.nvim/tree/main/lua/null-ls/builtins/formatting
@ -20,8 +49,8 @@ return {
null_ls.builtins.formatting.clang_format,
null_ls.builtins.formatting.csharpier,
null_ls.builtins.formatting.nixfmt,
null_ls.builtins.formatting.prettier,
null_ls.builtins.formatting.stylua,
deno_fmt,
}
return config -- return final config table
end,