Skip to content

Conversation

asifZaman0362
Copy link

No prettierd on NixOS and prettier is slow so added support for prettier_d_slim which happens to be even faster than prettierd.

Updated cli to support prettier_d_slim
Add support for prettier_d_slim
@MunifTanjim
Copy link
Owner

Does this support Prettier cli flags?

prettier.nvim/README.md

Lines 152 to 190 in d98e732

You can set [Prettier's options](https://prettier.io/docs/en/options.html) too.
They are passed to the `prettier` CLI.
```lua
prettier.setup({
cli_options = {
arrow_parens = "always",
bracket_spacing = true,
bracket_same_line = false,
embedded_language_formatting = "auto",
end_of_line = "lf",
html_whitespace_sensitivity = "css",
-- jsx_bracket_same_line = false,
jsx_single_quote = false,
print_width = 80,
prose_wrap = "preserve",
quote_props = "as-needed",
semi = true,
single_attribute_per_line = false,
single_quote = false,
tab_width = 2,
trailing_comma = "es5",
use_tabs = false,
vue_indent_script_and_style = false,
},
})
```
By default these options are only used if prettier config file is not found.
If you want to change that behavior, you can use the following option:
```lua
prettier.setup({
cli_options = {
-- https://prettier.io/docs/en/cli.html#--config-precedence
config_precedence = "prefer-file", -- or "cli-override" or "file-override"
},
})
```

@MunifTanjim
Copy link
Owner

Looks like prettier_d_slim does not support --config-precedence=prefer-file. Created a PR:

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

Successfully merging this pull request may close these issues.

2 participants