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

Added support for prettier_d_slim #31

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

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.

None yet

2 participants