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

Format docs with Prettier #704

Closed
sapegin opened this issue Nov 24, 2017 · 3 comments · Fixed by #709
Closed

Format docs with Prettier #704

sapegin opened this issue Nov 24, 2017 · 3 comments · Fixed by #709

Comments

@sapegin
Copy link
Member

sapegin commented Nov 24, 2017

  • Add script to package.json that will format Markdown files with Prettier.
  • Run it as part of npm test

Config could be similar to https://github.com/sapegin/blog.sapegin.me/blob/master/.prettierrc

@UmenR
Copy link

UmenR commented Nov 24, 2017

Hey @sapegin I'd like to take this up! but before i start i have a question to ask. Im a tad new to this so if i want to run prettier as part of npm test i could add it to the end of the current test script with a semicolon right ? but doing so would mean that if jest failed prettier wont run either. Im assuming that's not an issue ? and this also means that currently there is no config file for prettier right ? 😄

@sapegin
Copy link
Member Author

sapegin commented Nov 24, 2017

@UmenR Hey! Thanks for your interest, there’s a PR already: #709

There are two ways chain npm scripts:

  1. Use &&: npm run test:jest && npm run format:md — in this case if Jest fails it won’t run Prettier.
  2. Use pre* or post* scripts like pretest or posttest, you can find an example in our package.json.

@UmenR
Copy link

UmenR commented Nov 24, 2017

Oh did not see that PR 😄 Thanks for the response 👍

sapegin pushed a commit that referenced this issue Dec 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants