Skip to content

Commit a99d710

Browse files
committed
lint: fix typecheck errors
1 parent 1652d92 commit a99d710

1 file changed

Lines changed: 23 additions & 25 deletions

File tree

lua/conform/init.lua

Lines changed: 23 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -110,13 +110,12 @@ M.setup = function(opts)
110110
vim.log.levels.ERROR
111111
)
112112
end
113-
M.format(
114-
vim.tbl_deep_extend("force", format_args, {
115-
buf = args.buf,
116-
async = false,
117-
}),
118-
callback
119-
)
113+
local sync_format_opts = vim.tbl_deep_extend("force", format_args, {
114+
buf = args.buf,
115+
async = false,
116+
})
117+
---@cast sync_format_opts conform.FormatOpts
118+
M.format(sync_format_opts, callback)
120119
end
121120
end,
122121
})
@@ -163,25 +162,24 @@ M.setup = function(opts)
163162
vim.log.levels.ERROR
164163
)
165164
end
166-
M.format(
167-
vim.tbl_deep_extend("force", format_args, {
168-
buf = args.buf,
169-
async = true,
170-
}),
171-
function(err)
172-
num_running_format_jobs = num_running_format_jobs - 1
173-
if not err and vim.api.nvim_buf_is_valid(args.buf) then
174-
vim.api.nvim_buf_call(args.buf, function()
175-
vim.b[args.buf].conform_applying_formatting = true
176-
vim.cmd.update()
177-
vim.b[args.buf].conform_applying_formatting = false
178-
end)
179-
end
180-
if callback then
181-
callback(err)
182-
end
165+
local async_format_opts = vim.tbl_deep_extend("force", format_args, {
166+
buf = args.buf,
167+
async = true,
168+
})
169+
---@cast async_format_opts conform.FormatOpts
170+
M.format(async_format_opts, function(err)
171+
num_running_format_jobs = num_running_format_jobs - 1
172+
if not err and vim.api.nvim_buf_is_valid(args.buf) then
173+
vim.api.nvim_buf_call(args.buf, function()
174+
vim.b[args.buf].conform_applying_formatting = true
175+
vim.cmd.update()
176+
vim.b[args.buf].conform_applying_formatting = false
177+
end)
183178
end
184-
)
179+
if callback then
180+
callback(err)
181+
end
182+
end)
185183
end
186184
end,
187185
})

0 commit comments

Comments
 (0)