diff options
-rw-r--r-- | lua/conform/formatters/prettier.lua | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lua/conform/formatters/prettier.lua b/lua/conform/formatters/prettier.lua index ea45ffb..5b00d7b 100644 --- a/lua/conform/formatters/prettier.lua +++ b/lua/conform/formatters/prettier.lua @@ -1,3 +1,16 @@ +require("conform").setup({ + formatters = { + prettier = { + args = function(ctx) + if vim.endswith(ctx.filename, ".ejs") then + return { "--stdin-filepath", "$FILENAME", "--parser", "html" } + end + return { "--stdin-filepath", "$FILENAME" } + end, + }, + }, +}) + local util = require("conform.util") ---@type conform.FileFormatterConfig return { |