Skip to content

Make prettier setup more developer-friendly#178

Merged
justinanastos merged 2 commits intomasterfrom
update-prettier-setup
Feb 14, 2019
Merged

Make prettier setup more developer-friendly#178
justinanastos merged 2 commits intomasterfrom
update-prettier-setup

Conversation

@justinanastos
Copy link
Copy Markdown
Contributor

  • Remove git-staged in favor of precise-commits
  • Pre-prettify everything so there are no inadvertent prettier-related commits

This will only run the staged lines through prettier in a pre-commit hook.
This is in contrast to running the entire codebase through and trying to
stage it.

- Upgrade prettier to latest
- Remove git-staged in favor of [`precise-commits`](https://prettier.io/docs/en/precommit.html#option-4-precise-commits-https-githubcom-jameshenry-precise-commits)
- Upgrade husky
- Ignore package.json and package-lock.json with prettier
Why bother? If anyone uses automatic prettification in their editor,
unrelated changes are going to show up diffs. Let's just get them all out
of the way now.
Copy link
Copy Markdown
Contributor

@cheapsteak cheapsteak left a comment

Choose a reason for hiding this comment

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

Nice! iirc lint-staged commits the whole file's changes and caused a few accidental commits of parts of a file I didn't intend to commit (console logs, unrelated changes etc), it sounds like precise-commits solves that issue?

@justinanastos
Copy link
Copy Markdown
Contributor Author

Nice! iirc lint-staged commits the whole file's changes and caused a few accidental commits of parts of a file I didn't intend to commit (console logs, unrelated changes etc), it sounds like precise-commits solves that issue?

Exactly @cheapsteak . I also kept seeing the entire codebase getting prettier'ed and added. Instead of debugging it I just threw this in there.

@justinanastos justinanastos merged commit 1d85b57 into master Feb 14, 2019
@justinanastos justinanastos deleted the update-prettier-setup branch February 14, 2019 15:06
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