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

Add editorconfig, possibly prettier setup to all official starters #3922

Closed
fk opened this issue Feb 8, 2018 · 4 comments · May be fixed by tejzpr/gatsby#63
Closed

Add editorconfig, possibly prettier setup to all official starters #3922

fk opened this issue Feb 8, 2018 · 4 comments · May be fixed by tejzpr/gatsby#63

Comments

@fk
Copy link
Contributor

fk commented Feb 8, 2018

Let's discuss! 🎉 😉

@jquense
Copy link
Contributor

jquense commented Feb 8, 2018

I like the idea of setting up as much as possible for a someone getting started. I think the tension there is as you increase in options there is more and more for a user to remove if they don't agree with the choice, which is annoying if you use something often.

The other thing is I don't think you get an immediate benefit from either of these unless your editor is already configured to use them. I.e in VSCode you need an editorconfig extension as well as well as the prettier extension (to get format on save). This is can up requiring more configuration for folks that don't have these setup, or minimally demand they get familar with them.

On practical level, i'm 👍 for prettier, but have never found editorconfig helpful for my own projects or for shared OSS projects, since lots of folks don't know about it and so don't respect the config file anyway. And for stuff i work one myself, my editor is already configured to preferences i prefer :)

@fk
Copy link
Contributor Author

fk commented Feb 8, 2018

💯 Thank you @jquense. Agree with all of your points. Should have thought about this a little more. 😃

At least the default starter contains a "format" script already and that's what I thought of when adding Prettier to the title of this issue—make sure we have that in all starters. I'm almost sure it already is everywhere. The maintainers would ensure PR's being properly formatted before merging them, no need to add more confusion (and stuff to explain to) for beginners, and more advanced users would set these things up themselves anyway.

I thought of editorconfig as a kind of fallback for prettier…but you said everything already regarding that, too—it's probably not worth including it everywhere. Wouldn't hurt either. Maybe we add it and pick it up in the "Gatsby Starters" CONTRIBUTING.md I'm currently working on (and where all of this is coming from (#3750)). Compared to Prettier, its setup should be relatively easy to explain, and could serve as a good "hook" to introduce Prettier and/or link to a corresponding starter, e.g. https://github.com/kripod/gatsby-starter-strict.

@KyleAMathews
Copy link
Contributor

I agree with @jquense that we shouldn't push too many opinions on the starters. They're meant to be fairly open ended so we have to strike a balance between them being a generally useful starting point and not annoying people by making them remove things.

I added Prettier mainly to format the code in the starters. I'd assume most people who start sites either never look at the Prettier setup or customize it to meet their own needs.

@fk
Copy link
Contributor Author

fk commented Feb 8, 2018

Yep, I hear you. Let's close this!?

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