{"id":14993826,"url":"https://github.com/jgierer12/prettier-github","last_synced_at":"2025-10-03T09:31:22.124Z","repository":{"id":74177473,"uuid":"93988381","full_name":"jgierer12/prettier-github","owner":"jgierer12","description":"Format code in GitHub comments with Prettier","archived":true,"fork":false,"pushed_at":"2017-07-03T20:14:08.000Z","size":93,"stargazers_count":242,"open_issues_count":4,"forks_count":22,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-01-22T05:30:51.742Z","etag":null,"topics":["bot","github","javascript","prettier"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jgierer12.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-06-11T07:20:25.000Z","updated_at":"2024-01-09T10:25:21.000Z","dependencies_parsed_at":null,"dependency_job_id":"c304ecb7-0964-4c6b-b6db-4da03a304ad5","html_url":"https://github.com/jgierer12/prettier-github","commit_stats":{"total_commits":23,"total_committers":3,"mean_commits":7.666666666666667,"dds":"0.13043478260869568","last_synced_commit":"6143d0d25696b4009749ac42bc3d5d16beba0f69"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jgierer12%2Fprettier-github","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jgierer12%2Fprettier-github/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jgierer12%2Fprettier-github/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jgierer12%2Fprettier-github/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jgierer12","download_url":"https://codeload.github.com/jgierer12/prettier-github/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235109112,"owners_count":18937209,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bot","github","javascript","prettier"],"created_at":"2024-09-24T15:31:47.531Z","updated_at":"2025-10-03T09:31:16.851Z","avatar_url":"https://github.com/jgierer12.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Prettier GitHub [![Build Status](https://travis-ci.org/jgierer12/prettier-github.svg?branch=master)](https://travis-ci.org/jgierer12/prettier-github)\n\n\u003e Format code in GitHub comments with [Prettier](https://github.com/prettier/prettier)\n\n## Installation\n\n### GitHub app\n\nThis is the recommended and easiest installation method. Install the [Prettier GitHub app](https://github.com/apps/prettier-github) to some or all of your repos.\n\n### Self-hosted\n\n1. [![Deploy to now](https://deploy.now.sh/static/button.svg)](https://deploy.now.sh/?repo=https://github.com/jgierer12/prettier-github\u0026env=GITHUB_KEY\u0026env=GITHUB_ID\u0026env=GITHUB_WEBHOOK_SECRET) or [![Deploy to Heroku](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/jgierer12/prettier-github)\n1. Setup\n\t1. Register a [GitHub app](https://github.com/settings/apps/new)\n\t1. Use whatever makes sense for you for **App name**, **Description**, **Homepage URL** and **User authorization callback URL**; leave **Setup URL** empty\n\t1. Set **Webhook URL** to your deployment URL, for example `https://prettier-github.herokuapp.com/`\n\t1. Set a **Webhook secret** and note it down\n\t1. Select **Read \u0026 write** access for **Issues**, **Pull requests** and **Repository contents**\n\t1. For **Issues** and **Pull requests**, check **all** Webhook checkboxes; for **Repository contents**, check only **Commit comment**\n\t1. Click on **Create GitHub app**\n\t1. Click on **Generate private key** and save the downloaded file\n\t1. Note down the app **ID** (displayed under your username in the right column)\n1. Configure environment variables of your deployment\n\t1. Set `GITHUB_KEY` to the downloaded private key\n\t1. Set `GITHUB_ID` to the app ID\n\t1. Set `GITHUB_WEBHOOK_SECRET` to the Webhook secret you configured\n\n## Usage\n\nWhenever someone includes a JavaScript code block in a comment, it will be formatted using Prettier.\n\nBefore: ![Before](https://user-images.githubusercontent.com/4331946/27002184-bf126a80-4dda-11e7-9806-87d697cbe774.png)\n\nAfter: ![After](https://user-images.githubusercontent.com/4331946/27002183-b8f78f2c-4dda-11e7-9180-0d4210fee32b.png)\n\nYou can disable formatting per-comment by writing `\u003c!-- prettier-github disable --\u003e` anywhere in the comment (except code blocks)\n\n### Limitations\n\nDue to lacking GitHub APIs, Prettier GitHub currently doesn't format reviews, review comments and commit comments. See [#11](https://github.com/jgierer12/prettier-github/issues/11)\n\n## Configuration\n\nPrettier GitHub will use the `prettier` field in the `package.json` of the respective repository for configuration. See [Prettier's readme](https://github.com/prettier/prettier#options) for available options. Additionally, you can set `langs` to an array specifying which languages should be formatted.\n\n### Example\n\n`package.json`:\n```json\n{\n\t...\n\t\"prettier\": {\n\t\t\"singleQuote\": true,\n\t\t\"useTabs\": true,\n\t\t\"langs\": [\n\t\t\t\"js\",\n\t\t\t\"javascript\"\n\t\t]\n\t}\n\t...\n}\n```\n\nThis will enforce single quotes and tabs, and will only format code blocks marked as `js` or `javascript`.\n\n## Development\n\n1. Generate [personal access token](https://github.com/settings/tokens/new) with the **repo** scope for your GitHub account\n1. Install [ngrok](https://ngrok.com/) for localhost tunnelling\n1. Run `ngrok http 3000` and note down the URL, for example `http://2ab92a92.ngrok.io`\n1. Set up a [webhook](https://developer.github.com/webhooks/creating/#setting-up-a-webhook) for your testing repo\n\t1. Set **Payload URL** to the ngrok URL\n\t1. Set **Content type** to `application/json`\n\t1. Set a **Secret** and note it down\n\t1. Select **Let me select individual events**; then check **Commit comment**, **Issue comment**, **Issues**, **Pull request**, **Pull request review** and **Pull request review comment** and uncheck **Push**\n1. Copy `.env.example`\n\t1. Set `GITHUB_TOKEN` to the personal access token generated earlier\n\t1. Set `GITHUB_WEBHOOK_SECRET` to the Webhook secret you configured\n1. Run `npm install` and then `npm start`\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjgierer12%2Fprettier-github","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjgierer12%2Fprettier-github","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjgierer12%2Fprettier-github/lists"}