Skip to content

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

Closed
tejzpr/gatsby
#63
@fk

Description

@fk

Let's discuss! 🎉 😉

Activity

jquense

jquense commented on Feb 8, 2018

@jquense
Contributor

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

fk commented on Feb 8, 2018

@fk
ContributorAuthor

💯 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

KyleAMathews commented on Feb 8, 2018

@KyleAMathews
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

fk commented on Feb 8, 2018

@fk
ContributorAuthor

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Add editorconfig, possibly prettier setup to all official starters · Issue #3922 · gatsbyjs/gatsby