dotfiles/dot_config/nvim/lua/plugins/conform.lua.tmpl
punkfairie 71cedb1ca1
Update .config/nvim/lua/config/lazy.lua
Update .config/nvim/lua/plugins/conform.lua
Update .config/nvim/lua/plugins/mason.lua
Update .config/nvim/lua/plugins/nvim-lint.lua
Update .config/nvim/lua/plugins/nvim-lspconfig.lua
Update .config/nvim/lua/plugins/nvim-treesitter.lua
Remove .config/nvim/lua/plugins/refactoring.lua
Update tags
2024-06-10 17:48:49 -07:00

64 lines
1.9 KiB
Cheetah

local util = require("conform.util")
return {
{
"stevearc/conform.nvim",
-- @class ConformOpts
opts = {
formatters_by_ft = {
{{ if not .isServer -}}
-- lua
lua = { "stylua" },
{{ end -}}
-- data/conf
json = { "prettier" },
toml = { "taplo" },
yaml = { "prettier" },
-- web
html = { "prettier" },
liquid = { "prettier" },
css = { {{ if not .isServer }}"stylelint", {{ end }}"prettier" },
scss = { {{ if not .isServer }}"stylelint", {{ end }}"prettier" },
javascript = { {{ if not .isServer }}"eslint", {{ end }}"prettier" },
typescript = { {{ if not .isServer }}"eslint", {{ end }}"prettier" },
vue = { {{ if not .isServer }}"eslint", {{ end }}"prettier" },
markdown = { "prettier" },
{{ if not .isServer -}}
-- php
php = { "pint" },
blade = { "blade-formatter", "rustywind" },
{{ end -}}
-- shell
sh = { "shellcheck", "shfmt" },
fish = { "fish_indent" },
-- misc
ruby = { "prettier" },
},
formatters = {
shfmt = {
prepend_args = { "--indent=2", "--case-indent", "--binary-next-line", "--func-next-line" },
},
{{ if not .isServer -}}
pint = {
meta = {
url = "https://github.com/laravel/pint",
description = "Laravel Pint is an opinionated PHP code style fixer for minimalists. Pint is built on top of PHP-CS-Fixer and makes it simple to ensure that your code style stays clean and consistent.",
},
command = util.find_executable({
vim.fn.stdpath("data") .. "/mason/bin/pint",
"vendor/bin/pint",
}, "pint"),
args = { "$FILENAME" },
stdin = false,
},
{{ end -}}
},
},
},
}