prettier-package-json
prettier-package-json copied to clipboard
added prettier config
Motivation
I wanted to make things easier for contributors.
Summary
Most of the formatting in this project closely matches the formatting in the attached prettier config (which I graciously stole from this file from another repo by by @cameronhunter).
- Added
prettierrc.js
- Reformatted each file (one commit at a time) subjectively adding
// prettier-ignore
&//
comments to minimize changes.
Shortlist of potentially most controversial changes
-
Reformatting the README.md according to prettier is the largest change outside of adding
prettierrc.js
. Arguably they could be added to the.prettierignore
instead, but I noticed the original prettier file had a rule for .md in it so I kept the change. -
I added
__fixtures__
to.prettierignore
. I figured test data shouldn't be autoformatted.
Additional note
Tests passed
Steps
- Installed.
yarn
- Built.
yarn build
- Tested.
yarn test
On Opinions
Code formatting is an opinionated thing. It's good to make these opinions explicit through prettier.
However, your preferred formatting may not be what I've done here. That's why I tried to put each change in its own file.
Additionally, there's always this technique as well for preserving git history.