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 GitHub Action support to format docs #23

Closed
iamrajiv opened this issue Aug 28, 2022 · 0 comments · Fixed by #25
Closed

Add Prettier GitHub Action support to format docs #23

iamrajiv opened this issue Aug 28, 2022 · 0 comments · Fixed by #25
Labels
enhancement New feature or request

Comments

@iamrajiv
Copy link
Member

iamrajiv commented Aug 28, 2022

Problem statement

Prettier is a very popular code formatter that uses very opinionated but sensible styles to format your code and prevent ongoing debates about code styles. So we wanted a GitHub action to automatically format your code using Prettier.

Describe the solution you'd like

The solution utilizes the git-auto-commit-action alongside whatever formatting script we have in your repository.

For example, our repository has the following script to format using Prettier:

"format": "prettier --write '**/*.{css,html,js,json,jsx,md,mdx,ts,tsx,yaml,yml}'",

To set up the GitHub action, all we need to do is install our dependencies (e.g. yarn install), run our format script (e.g. yarn format), and then commit any changes if necessary.

Additional context

By utilizing Prettier with GitHub Actions, we can ensure that our code is formatted consistently and without any issues.
It also helps to reduce manual work when formatting code.

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

Successfully merging a pull request may close this issue.

1 participant