feat(nvim): add stylua config
This commit is contained in:
parent
e6fb8cc478
commit
eb86f4860c
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"workspace.checkThirdParty": false
|
||||
}
|
|
@ -7,10 +7,17 @@ local prettier = function()
|
|||
end
|
||||
|
||||
require('formatter').setup({
|
||||
log_level = vim.log.levels.INFO,
|
||||
filetype = {
|
||||
javascript = { prettier },
|
||||
typescript = { prettier },
|
||||
typescriptreact = { prettier },
|
||||
|
||||
-- https://github.com/JohnnyMorganz/StyLua
|
||||
-- cargo install stylua --features lua54
|
||||
lua = {
|
||||
require("formatter.filetypes.lua").stylua
|
||||
},
|
||||
}
|
||||
})
|
||||
|
||||
|
@ -18,7 +25,7 @@ require('formatter').setup({
|
|||
vim.api.nvim_exec2([[
|
||||
augroup FormatAutogroup
|
||||
autocmd!
|
||||
autocmd BufWritePost *.js,*.ts,*.tsx silent FormatWrite
|
||||
autocmd BufWritePost *.js,*.ts,*.tsx,*.lua silent FormatWrite
|
||||
augroup END
|
||||
]], { output = true })
|
||||
|
||||
|
|
Loading…
Reference in New Issue