Skip to content
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

Support for environment variables? #8

Closed
heygarrett opened this issue Aug 29, 2023 · 1 comment
Closed

Support for environment variables? #8

heygarrett opened this issue Aug 29, 2023 · 1 comment

Comments

@heygarrett
Copy link

Is there an option to use environment variables with specific formatters? I'd like to set PRETTIERD_LOCAL_PRETTIER_ONLY without redefining the prettierd formatter.

@stevearc
Copy link
Owner

I've added support for environment variables. You can set it with

require("conform.formatters.prettierd").env = {
  PRETTIERD_LOCAL_PRETTIER_ONLY = "1",
}

or if you'd prefer

require("conform").setup({
  formatters = {
    prettierd = vim.tbl_deep_extend("force", require("conform.formatters.prettierd"), {
      env = {
        PRETTIERD_LOCAL_PRETTIER_ONLY = "1",
      },
    }),
  },
})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants