From cec95d7a0c718edbbb4169de03e64e46da492875 Mon Sep 17 00:00:00 2001 From: Oliver Ladner Date: Wed, 26 Feb 2025 17:04:47 +0100 Subject: [PATCH] fix(conform): replace formatters_by_ft with new 9.x version --- lua/weeheavy/plugins/lsp/conform.lua | 60 ++++++++++++++-------------- 1 file changed, 31 insertions(+), 29 deletions(-) diff --git a/lua/weeheavy/plugins/lsp/conform.lua b/lua/weeheavy/plugins/lsp/conform.lua index 810be46..b8f513b 100644 --- a/lua/weeheavy/plugins/lsp/conform.lua +++ b/lua/weeheavy/plugins/lsp/conform.lua @@ -1,32 +1,34 @@ -- Some things are from https://www.josean.com/posts/neovim-linting-and-formatting return { - "stevearc/conform.nvim", - tag = "stable", - opts = {}, - config = function() - local conform = require("conform") - conform.setup({ - formatters_by_ft = { - javascript = { "prettier" }, - typescript = { "prettier" }, - javascriptreact = { "prettier" }, - typescriptreact = { "prettier" }, - svelte = { "prettier" }, - css = { "prettier" }, - html = { "prettier" }, - json = { "prettier" }, - yaml = { "prettier" }, - markdown = { "prettier" }, - graphql = { "prettier" }, - lua = { "stylua" }, - python = { "isort", "black" }, - sh = { "shfmt" }, - }, - format_on_save = { - lsp_fallback = true, - async = false, - timeout_ms = 1000, -- default: 1000 - }, - }) - end, + "stevearc/conform.nvim", + tag = "stable", + opts = {}, + config = function() + local conform = require("conform") + conform.setup({ + -- formatters_by_ft = { + formatters = { + javascript = { "prettier" }, + typescript = { "prettier" }, + javascriptreact = { "prettier" }, + typescriptreact = { "prettier" }, + svelte = { "prettier" }, + css = { "prettier" }, + html = { "prettier" }, + json = { "prettier" }, + yaml = { "prettier" }, + markdown = { "prettier" }, + graphql = { "prettier" }, + lua = { "stylua" }, + python = { "isort", "black" }, + sh = { "shfmt" }, + }, + stop_after_first = false, + format_on_save = { + lsp_fallback = true, + async = false, + timeout_ms = 1000, -- default: 1000 + }, + }) + end, }