{"id":13801931,"url":"https://github.com/hipstersmoothie/eslint-formatter-github","last_synced_at":"2025-05-16T18:06:44.223Z","repository":{"id":50318977,"uuid":"202953837","full_name":"hipstersmoothie/eslint-formatter-github","owner":"hipstersmoothie","description":"See ESLint errors and warnings directly in pull requests.","archived":false,"fork":false,"pushed_at":"2024-12-08T18:18:59.000Z","size":963,"stargazers_count":107,"open_issues_count":15,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-16T18:06:40.960Z","etag":null,"topics":["eslint","eslint-formatter","github","github-checks","github-checks-api"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/hipstersmoothie.png","metadata":{"files":{"readme":"readme.md","changelog":"CHANGELOG.md","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":"2019-08-18T03:07:12.000Z","updated_at":"2025-03-20T04:06:03.000Z","dependencies_parsed_at":"2022-09-06T09:50:30.371Z","dependency_job_id":"9ecf6d04-3bd4-4361-a64b-a744f4dc8cbb","html_url":"https://github.com/hipstersmoothie/eslint-formatter-github","commit_stats":{"total_commits":166,"total_committers":5,"mean_commits":33.2,"dds":0.3614457831325302,"last_synced_commit":"c3fb5d13be92fef1b09415fc7242e23a6c8104b1"},"previous_names":[],"tags_count":37,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hipstersmoothie%2Feslint-formatter-github","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hipstersmoothie%2Feslint-formatter-github/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hipstersmoothie%2Feslint-formatter-github/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hipstersmoothie%2Feslint-formatter-github/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hipstersmoothie","download_url":"https://codeload.github.com/hipstersmoothie/eslint-formatter-github/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254582905,"owners_count":22095518,"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":["eslint","eslint-formatter","github","github-checks","github-checks-api"],"created_at":"2024-08-04T00:01:30.750Z","updated_at":"2025-05-16T18:06:44.201Z","avatar_url":"https://github.com/hipstersmoothie.png","language":"TypeScript","funding_links":[],"categories":["Formatters"],"sub_categories":["Testing Tools"],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003cimg  height=\"200\"\n    src=\"./logo.png\"\u003e\n  \u003ch1\u003eeslint-formatter-github\u003c/h1\u003e\n  \u003cp\u003eSee ESLint errors and warnings directly in pull requests.\u003c/p\u003e\n\u003c/div\u003e\n\n## Highlights\n\n- Report your eslint results as annotations using the [GitHub Checks API](https://developer.github.com/v3/checks/)\n- Only runs in CI environment\n- Uses [eslint-formatter-pretty](https://github.com/sindresorhus/eslint-formatter-pretty) as the formatter for displaying the lint results\n\n![Example of annotations being included in a pull request](./example.png)\n\n## Install\n\n```sh\nnpm install --save-dev eslint-formatter-github\n# or\nyarn add -D eslint-formatter-github\n```\n\n## Usage\n\nYou will need to install [the github app](https://github.com/apps/eslint-results) to your repo.\n\nThen just use the formatter and it will report errors and warnings on PRs!\n\n```sh\neslint --format github file.js\n```\n\n## Using you own GitHub App (recommended)\n\nYou might not want to use our github app for the formatter.\n\nReasons:\n\n1. You think they way we exposed the keys is bad\n2. You are on Github Enterprise and cannot use the public app\n\nIn these situations all you need to do is create a GitHub app and set a few environment variables.\n\n### 1. Create a GitHub app\n\nGo to [this page](https://github.com/settings/apps) to create a new GitHub app. You need to set the following fields:\n\n- `name` - The name that shows for your app in the checks reports\n- `Homepage URL` - You can set this to anything. Ours is set to `https://github.com`\n- `Webhook URL` - You can set this to anything. Ours is set to `https://github.com`\n\nThen hit `Save Changes` and you're all done setting up your GitHub app.\n\nYou need to configure Permissions for your GitHub app. You need to set the following permissions:\n\n- `Checks` - `Read \u0026 Write`\n- `Metadata` - `Read-only`\n\n### 2. Set `ESLINT_APP_ID` environment variable\n\nYour GitHub application's ID. This can be found at the top of your GitHub app's edit page.\n\n### 3. Set `ESLINT_PRIVATE_KEY` environment variable\n\nThe private RSA key for your application. The prompt to generate the RSA key is at the bottom of your GitHub app's edit page.\n\nOnce you have generated a key, open the file that is downloaded and copy to text into the `PRIVATE_KEY` environment variable.\n\nWhen using GitHub Actions, you can use the environment variable `ESLINT_PRIVATE_KEY_BASE64` to set the private key base64 encoded.\nThis fix the issue with the new line characters in the private key.\n\nTo encode the private key, you can use the following command:\n\n```sh\ncat private-key.pem | base64\n```\n\n### 4. Set `GH_API` (enterprise only)\n\nTo get this package to work on github enterprise instances you will need to set the `GH_API` environment variable to a url pointing towards your enterprise GitHub's API.\n\n### 5. (optional) Set `GH_CHECK_NAME`\n\nIf the default check name conflicts with something, you can override it by passing `GH_CHECK_NAME` environment variable.\n\n### Example for GitHub Actions\n\n\u003e **Warning**\n\u003e It is strongly recommended to create your own GitHub app and never share your private key with third parties.\n\u003e Otherwise, unauthorized persons can read meta data and manipulate checks.\n\n```yaml\nname: Lint\non: [pull_request]\njobs:\n  lint:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v3\n      - uses: actions/setup-node@v3\n        with:\n          node-version: 18\n      - run: npm install\n      - run: eslint src --ext .ts,.js --format github\n        env:\n          ESLINT_APP_ID: ${{ secrets.ESLINT_APP_ID }}\n          ESLINT_PRIVATE_KEY_BASE64: ${{ secrets.ESLINT_PRIVATE_KEY_BASE64 }}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhipstersmoothie%2Feslint-formatter-github","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhipstersmoothie%2Feslint-formatter-github","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhipstersmoothie%2Feslint-formatter-github/lists"}