Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add prettier #467

Merged
merged 2 commits into from
Feb 11, 2019
Merged

Add prettier #467

merged 2 commits into from
Feb 11, 2019

Conversation

wangyiz4262
Copy link
Contributor

Use Prettier to format source files

@codecov-io
Copy link

codecov-io commented Jan 27, 2019

Codecov Report

Merging #467 into dev will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@         Coverage Diff         @@
##            dev   #467   +/-   ##
===================================
  Coverage   100%   100%           
===================================
  Files        58     58           
  Lines       509    509           
  Branches     83     83           
===================================
  Hits        509    509

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a7e05e0...35ca99d. Read the comment docs.

@iamkun
Copy link
Owner

iamkun commented Feb 2, 2019

Thanks, but I'm not sure if this is a must do change, since the format rules of prettier has a little different with es-lint in .js files. But markdown format looks great.

@wangyiz4262
Copy link
Contributor Author

@iamkun I understand this is not a must-do change, but rather a nice-to-have feature. However with more and more people starting to contribute on this project, coding style will become more important.

While people still have to manually fix their styles even with eslint, with the help of Prettier, complying consistent coding styles will be super easy.

I tried to match the rules of eslint to Prettier. And should any difference be found, I will definitely make sure they are in sync.

@iamkun
Copy link
Owner

iamkun commented Feb 2, 2019

@wangyiz4262 Sounds great. But please allow me some time to think it over.

@wangyiz4262
Copy link
Contributor Author

@iamkun Of course! And I would be very much pleased to help if possible.

@iamkun
Copy link
Owner

iamkun commented Feb 2, 2019

@wangyiz4262 one more thing, it would be great if you could make a new PR with only prettier added to the project as well as the pre-commit lint or something alike, and we could do prettier during our CI running. A PR 104 files change make it impossible to review.

@wangyiz4262
Copy link
Contributor Author

@iamkun Very happy to. I will get that done tomorrow. Actually it is not necessary to make a new PR. I can force push the changes so that this PR will be updated accordingly.

@iamkun
Copy link
Owner

iamkun commented Feb 2, 2019

@wangyiz4262 that would be nice, take your time please.

@wangyiz4262
Copy link
Contributor Author

Hi @iamkun, I added Prettier into CI but disabled pre-commit because it wouldn't let me commit without updating all the files. Therefore I need you to approve the PR first, and then I will create another PR to re-enable eslint in the pre-commit hook.

@wangyiz4262
Copy link
Contributor Author

wangyiz4262 commented Feb 2, 2019

@iamkun I just realized this won't work because just adding Prettier to CI will only prettify files on the fly. The real source files still don't change. There has to be a big change contain all the prettified files.

@iamkun
Copy link
Owner

iamkun commented Feb 2, 2019

How about we just start from .md files. Simply add prettier and a npm script, and that's enough. After that we could consider this should be added to precommit or ci or something else.

@wangyiz4262
Copy link
Contributor Author

@iamkun I added Prettier configuration without hook up to eslint, and also formatted all the markdown files in a separate commit.

@iamkun
Copy link
Owner

iamkun commented Feb 3, 2019

Looks good, but better revert the last commit and leave the only change with add prettier. There's no need to review diffs made by prettier.

@wangyiz4262
Copy link
Contributor Author

@iamkun Got you. I have reverted the last commit. The source files can be prettified at any time later.

@iamkun iamkun merged commit 0034349 into iamkun:dev Feb 11, 2019
@iamkun
Copy link
Owner

iamkun commented Feb 14, 2019

🎉 This PR is included in version 1.8.6 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants