mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-06-22 17:03:39 +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
|
||||
end
|
||||
if enabled[ctx.filename] == nil then
|
||||
enabled[ctx.filename] = vim.fs.find(function(name, path)
|
||||
return name:match("^%.prettierrc%.?") or name:match("^prettier%.config%.")
|
||||
end, { path = ctx.filename, upward = true })[1] ~= nil
|
||||
vim.fn.system({ "prettier", "--find-config-path", ctx.filename })
|
||||
enabled[ctx.filename] = vim.v.shell_error == 0
|
||||
end
|
||||
return enabled[ctx.filename]
|
||||
end,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue