Make prettier setup more developer-friendly#178
Merged
justinanastos merged 2 commits intomasterfrom Feb 14, 2019
Merged
Conversation
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.
cheapsteak
approved these changes
Feb 14, 2019
Contributor
cheapsteak
left a comment
There was a problem hiding this comment.
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?
Contributor
Author
Exactly @cheapsteak . I also kept seeing the entire codebase getting prettier'ed and added. Instead of debugging it I just threw this in there. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
precise-commits