2024-03-08 17:27:00 -08:00
local util = require ( " conform.util " )
2024-02-21 19:42:52 -08:00
return {
2024-03-03 17:00:27 -08:00
{
" stevearc/conform.nvim " ,
2024-02-21 19:42:52 -08:00
2024-03-03 17:00:27 -08:00
-- @class ConformOpts
opts = {
formatters_by_ft = {
-- lua
lua = { " stylua " } ,
2024-02-21 19:42:52 -08:00
2024-03-03 17:00:27 -08:00
-- data/conf
sql = { " prettier " } ,
json = { " prettier " } ,
2024-03-10 18:58:47 -07:00
toml = { " taplo " } ,
2024-03-03 17:00:27 -08:00
yaml = { " prettier " } ,
2024-02-21 19:42:52 -08:00
2024-03-03 17:00:27 -08:00
-- web
html = { " prettier " } ,
liquid = { " prettier " } ,
css = { " stylelint " , " prettier " } ,
scss = { " stylelint " , " prettier " } ,
javascript = { " eslint " , " prettier " } ,
typescript = { " eslint " , " prettier " } ,
vue = { " eslint " , " prettier " } ,
markdown = { " prettier " } ,
2024-02-21 19:42:52 -08:00
2024-03-03 17:00:27 -08:00
-- php
php = { " pint " } ,
2024-03-08 17:27:00 -08:00
blade = { " blade-formatter " , " rustywind " } ,
2024-02-21 19:42:52 -08:00
2024-03-03 17:00:27 -08:00
-- shell
sh = { " shellcheck " , " shfmt " } ,
fish = { " fish_indent " } ,
2024-02-21 19:42:52 -08:00
2024-03-03 17:00:27 -08:00
-- misc
ruby = { " prettier " } ,
} ,
formatters = {
shfmt = {
prepend_args = { " --indent=2 " , " --case-indent " , " --binary-next-line " , " --func-next-line " } ,
} ,
2024-03-08 17:27:00 -08:00
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 ,
} ,
2024-03-03 17:00:27 -08:00
} ,
} ,
} ,
2024-02-21 19:42:52 -08:00
}