-
Notifications
You must be signed in to change notification settings - Fork 176
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Configuration file loading #494
Comments
Hi @maobai405, any luck with this? |
You can define prepend_args = function(self, ctx)
local util = require("conform.util")
-- you may want to include all the possible config file names
-- see https://github.com/stevearc/conform.nvim/blob/46c107ad0e7d83b5a7091112ec2994c847577d32/lua/conform/formatters/prettier.lua#L64-L77
local config_file = vim.fs.find({".prettierrc", "prettierrc.json"}, { upward = true, path = ctx.dirname })[1]
if config_file then
return {} -- don't need to return anything because it will pick up the file from the cwd
else
return { "--config=" .. vim.fn.expand("~/.config/nvim/prettierrc.json") }
end
end |
What if I want to use biome only if there's biome.json in the directory? |
@yamiteru set |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In my
config
file I configured this:However, I expected that if there's a
prettierrc.json
file in my project directory, it will be formatted according to the configuration in the project, instead of the configuration in theprepend_args
path. How can I achieve this?The text was updated successfully, but these errors were encountered: