From bedd1064164cbb143ad08d589977dd2b4692fdd2 Mon Sep 17 00:00:00 2001 From: Michael Mandl Date: Tue, 8 Mar 2022 08:33:07 +0100 Subject: [PATCH] feat: format with prettier via stdin --- nvim/lua/plugins/lspconfig.lua | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/nvim/lua/plugins/lspconfig.lua b/nvim/lua/plugins/lspconfig.lua index dff702d..a65c834 100644 --- a/nvim/lua/plugins/lspconfig.lua +++ b/nvim/lua/plugins/lspconfig.lua @@ -31,21 +31,25 @@ local extra_server_opts = { languages = { lua = {{formatCommand = "lua-format -i", formatStdin = true}}, html = { - {formatCommand = "yarn run --silent prettier --parser html"} + formatCommand = "yarn run --silent prettier --stdin-filepath ${INPUT} --parser html", + formatStdin = true }, typescript = { { - formatCommand = "yarn run --silent prettier --parser typescript" + formatCommand = "yarn run --silent prettier --stdin-filepath ${INPUT} --parser typescript", + formatStdin = true } }, typescriptreact = { { - formatCommand = "yarn run --silent prettier --parser typescript" + formatCommand = "yarn run --silent prettier --stdin-filepath ${INPUT} --parser typescript", + formatStdin = true } }, markdown = { { - formatCommand = "yarn run --silent prettier --parser markdown" + formatCommand = "yarn run --silent prettier --stdin-filepath ${INPUT} --parser markdown", + formatStdin = true } } }