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

RFC: Implement Prettier formatting for pmc-larva packages #179

Open
curtisbelt opened this issue Apr 8, 2020 · 1 comment
Open

RFC: Implement Prettier formatting for pmc-larva packages #179

curtisbelt opened this issue Apr 8, 2020 · 1 comment
Assignees
Labels
addition New feature or request

Comments

@curtisbelt
Copy link
Contributor

Dealing with styles can be a huge time sink:

  • distracting merging conflicts when IDE's have some default formatting in lieu of no default being available
  • breaking habits manually is hard and requires mental attention
  • potentially high mental capacity cost to properly scan a project manually to check for specific patterns and make sure you're consistent.

What I have found is that this requires an auto-format solution that is comprehensive enough to leave very little room for personal touch -- and where that room exists, it's so minuscule that making it unregulated is OK.

The end result is absolute ~98% consistency while eliminating all manual labor or attention concerning code format.

For the past 3-4 years, all my JS projects automatically come with https://prettier.io/. This is hooked into the existing eslint --fix functionality so it's not reliant on any IDE. The workflow I recommend is to auto-format on file save so the code is perfect at any given moment so you don't have to deal with it even while actively writing.

This can also be enforced via eslint or auto-run via git hooks.

This is all stuff I've prepared in the past so I'm happy to set this all up -- want to know what people's thoughts are! Thanks.

@curtisbelt curtisbelt added the addition New feature or request label Apr 8, 2020
@curtisbelt curtisbelt self-assigned this Apr 8, 2020
@aaronjorbin
Copy link
Contributor

Prettier's default styles are fairly different than all of our other JS. wp-prettier with the @wordpress/prettier-config keeps the standards inline with the rest of the code we are writing.

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

No branches or pull requests

2 participants