penske-media-corp / pmc-larva

PMC's design system.
pmc-larva-git-master-penske-media-corp.vercel.app
MIT License
19 stars 14 forks source link

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

Open curtisbelt opened 4 years ago

curtisbelt commented 4 years ago

Dealing with styles can be a huge time sink:

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.

aaronjorbin commented 4 years ago

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.