prettier-package-json icon indicating copy to clipboard operation
prettier-package-json copied to clipboard

added prettier config

Open JamesGelok opened this issue 3 years ago • 0 comments

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).

  1. Added prettierrc.js
  2. Reformatted each file (one commit at a time) subjectively adding // prettier-ignore & // comments to minimize changes.

Shortlist of potentially most controversial changes

  1. 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.

  2. I added __fixtures__ to .prettierignore. I figured test data shouldn't be autoformatted.

Additional note

Tests passed

Steps

  1. Installed.
yarn 
  1. Built.
yarn build
  1. 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.

JamesGelok avatar Jun 15 '21 11:06 JamesGelok