Skip to content

Conversation

@mikehardy
Copy link
Contributor

Hi there!

You mentioned #62 was too much for one PR, so I'm splitting it up.

Formatting changes obviously perturb any visual review of any code so I'm doing those first.

There are zero functional changes in the code in this PR. It is all spacing, nothing else.

Discussions of formatting frequently devolve to strong opinions about how things should be formatted, I want to be 100% clear here that I do not actually care about how things are formatted at all, just as a developer and repo maintainer I want consistent formatting.

So I just took the github actions repo prettier as a hopefully non-controversial baseline, and then added husky (for local enforcement) and a github workflow (for CI enforcement).

It follows then that if any specific choice here is not something you like, great! I'll tweak the .prettierrc.json until it has things the way you like.

The prettier config was adapted from the official GitHub Actions repo,
bent to fit the prevailing style (where possible) already in the project

The intent is not to be controversial or argue about whitespace, it is just
to have a consistent easy-to-verify style specifically to avoid all arguments
about whitespace. If anything in here is objectionable, just name the setting
to alter and I can edit / re-format / re-push

chore: add husky and hook build/format/lint checks to pre-commit

This enforces the same checks locally that will execute in CI

With this, everyone should have a clean / consistent dev environment,
and it will be clear to contributors if they submit code that is not valid
typescript

Additionally, after doing the build it adds the dist/index.js output to the
commit list so contributors can't forget to commit it

lint(prettier): trailingComma preferred as all vs none

Co-authored-by: Steven <[email protected]>
Copy link
Owner

@styfle styfle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work, thanks! 🏅

@styfle styfle merged commit 3079606 into styfle:main Apr 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants