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

Passing CLI options to prettier #165

Closed
cenk1cenk2 opened this issue Apr 19, 2021 · 2 comments · Fixed by #167
Closed

Passing CLI options to prettier #165

cenk1cenk2 opened this issue Apr 19, 2021 · 2 comments · Fixed by #167
Labels
enhancement New feature or request

Comments

@cenk1cenk2
Copy link
Contributor

cenk1cenk2 commented Apr 19, 2021

Hello @fsouza ,

Is it possible to pass configuration options to prettier itself via flags? Or even enabling a global fallback prettierrc creating .prettierrc on ~?

@fsouza
Copy link
Owner

fsouza commented Apr 19, 2021

Hi @cenk1cenk2, thanks for opening this issue. Having project-local configuration is part of prettier's philosophy and I wouldn't want to deviate from that.

Prettier intentionally doesn’t support any kind of global configuration. This is to make sure that when a project is copied to another computer, Prettier’s behavior stays the same. Otherwise, Prettier wouldn’t be able to guarantee that everybody in a team gets the same consistent results.

(from https://prettier.io/docs/en/configuration.html)

In terms of supporting the flags, I think that's an OK addition. Ideally everyone would be using local config files, but if pretter supports flags, we could support the same parameters.

@fsouza fsouza added the enhancement New feature or request label Apr 19, 2021
@cenk1cenk2
Copy link
Contributor Author

cenk1cenk2 commented Apr 19, 2021

That would be a great addition for me. I can give it a go this weekend if you don't have enough time. Since I prefer single quotes in every where and sometimes there is no prettier configuration in the workspaces that I work, mostly yml files related to developer operations.

If you accept the other approach, overriding the behaviour from prettier, I can give it a go to that like enabling it with a environmental variable to be sure DEFAULT_CONFIG=~/.prettierrc prettierd ... or something like that.

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

Successfully merging a pull request may close this issue.

2 participants