joelgriffith / navalia

A bullet-proof, fast, and reliable headless browser API
https://joelgriffith.github.io/navalia/
GNU General Public License v3.0
957 stars 33 forks source link

Adds pre-commit prettier hook and runs prettier across the codebase. #25

Closed mute closed 7 years ago

mute commented 7 years ago

This adds prettier along with a precommit hook to run it automatically for .ts files being committed.

I added the configuration options to use single quotes and to also add trailing commas for objects and arrays.

It should also integrate really easily with most IDEs; want me to add something to README.md somewhere mentioning it as well?

joelgriffith commented 7 years ago

Awesome, this doesn't look that bad, and thanks for adding in the switches.

Not sure if we need to call it out in the README, but maybe the CONTRIBUTING file (I just threw it up recently) would be a better fit. Just a quick heads up type of disclaimer so ppl aren't stunned by the change

joelgriffith commented 7 years ago

ALSO https://github.com/prettier/prettier#badge

joelgriffith commented 7 years ago

I pushed up the docs portion of this functionality. I'm not terribly thrilled with the \n of the methods, but i'll deal.

mute commented 7 years ago

@joelgriffith Yeah, the way it handles long strings isn't ideal -- we could bump up the desired line width setting from the default (80 char) but the prettier docs suggest not doing that. ¯_(ツ)_/¯