mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-06-22 08:53:33 +02:00
fix(prettier): use prettier to check if prettier should run on the file
This commit is contained in:
parent
a9aea4b5a1
commit
0255b8fdb1
1 changed files with 2 additions and 3 deletions
|
@ -57,9 +57,8 @@ return {
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
if enabled[ctx.filename] == nil then
|
if enabled[ctx.filename] == nil then
|
||||||
enabled[ctx.filename] = vim.fs.find(function(name, path)
|
vim.fn.system({ "prettier", "--find-config-path", ctx.filename })
|
||||||
return name:match("^%.prettierrc%.?") or name:match("^prettier%.config%.")
|
enabled[ctx.filename] = vim.v.shell_error == 0
|
||||||
end, { path = ctx.filename, upward = true })[1] ~= nil
|
|
||||||
end
|
end
|
||||||
return enabled[ctx.filename]
|
return enabled[ctx.filename]
|
||||||
end,
|
end,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue