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

Check-in a Prettier config file for editor extensions #211

Closed
wholesomedev opened this issue Nov 19, 2017 · 7 comments
Closed

Check-in a Prettier config file for editor extensions #211

wholesomedev opened this issue Nov 19, 2017 · 7 comments
Assignees

Comments

@wholesomedev
Copy link
Contributor

wholesomedev commented Nov 19, 2017

Can we check-in a Prettier config file which will inform Prettier extensions in editors of how to format code?

If so, can we put it in our common repo and extend it from the other repos?

@forabi
Copy link
Contributor

forabi commented Nov 19, 2017

The unofficial prettier extension for VS Code can read configuration from a field named prettier in package.json. However, this field is not something officially supported by prettier and I don't know of any other code editor extensions that support it. So we need to duplicate the configuration for VS Code extension and the CLI command which is run on every commit.

@forabi
Copy link
Contributor

forabi commented Nov 19, 2017

Relevant issue: prettier/prettier#62

@wholesomedev
Copy link
Contributor Author

I'm okay with either approach.

@forabi
Copy link
Contributor

forabi commented Nov 19, 2017

I'm okay with either approach.

So should we add the "prettier" field for VS Code extension? I don't see the point. The files will be prettified when committed anyway.

@wholesomedev
Copy link
Contributor Author

Problem is someone (like me) might have different default configurations in their editor. Now whenever they edit one of our files, the whole file gets reformatted and it's a little jarring. That's what I'm hoping to solve.

@wholesomedev
Copy link
Contributor Author

wholesomedev commented Nov 19, 2017

@forabi Can't we get the CLI and editor extensions both to read from one of these config files?
https://prettier.io/docs/en/configuration.html

@forabi
Copy link
Contributor

forabi commented Nov 19, 2017

Can't we get the CLI to read from one of these config files?

Sorry, I didn't realize that prettier supports a configuration file. I will look into that.

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