Registry / devops / eslint-formatter-github

eslint-formatter-github

JSON →
library1.1.4jsnpmunverified

An ESLint formatter that reports lint results as annotations in GitHub pull requests using the Checks API. Version 1.1.4 is the current stable release, with irregular updates. It requires ESLint >= 5.x and a GitHub App for authentication. Key differentiators: direct PR annotation integration, supports GitHub Enterprise, and uses eslint-formatter-pretty for console output. Unlike other formatters, it automatically detects CI environment and only runs there.

npm install eslint-formatter-github
INSTALL
IMPORT
SIG · ESLINT-FORMATTER-G
E
eslint-formatter-github
devopsjavascriptv1.1.4
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

No default import – used as CLI argument
eslint --format github file.js
import formatter from 'eslint-formatter-github'
Package is a formatter for ESLint CLI, not a JavaScript module. Use via CLI or config file.
ESLint config (legacy)
format: 'github' // in .eslintrc
require('eslint-formatter-github')
Set in ESLint configuration as a string, not imported.
ESLint flat config (v9+)
import eslintPluginGithub from 'eslint-formatter-github/flat'; // Not available – check docs
plugins: ['eslint-formatter-github']
This package does not officially support flat config; use legacy format or CLI flag.

Installs package and runs ESLint with GitHub formatter to report results as PR annotations.

npm install --save-dev eslint eslint-formatter-github eslint --format github src/ # Ensure environment variables are set in CI: # ESLINT_APP_ID, ESLINT_PRIVATE_KEY (or ESLINT_PRIVATE_KEY_BASE64 for GH Actions)
Debug
Known issues
gotchaRequires a GitHub App (own or shared) – formatter will fail silently or error if not configured.
fix
Create a GitHub App and set ESLINT_APP_ID and ESLINT_PRIVATE_KEY (or use base64).
affects: >=1.0.0
deprecatedUse of shared GitHub app (eslint-results) is discouraged – read-only access to checks.
fix
Use your own GitHub App to avoid security risks.
affects: >=1.0.0
gotchaDoes not support ESLint flat config (eslint.config.js) – only legacy .eslintrc.
fix
Use eslint --format github CLI flag or configure in .eslintrc file.
affects: >=1.0.0
breakingOnly runs in CI environment – local runs produce no output.
fix
Set CI=true environment variable to test locally.
affects: >=1.0.0
gotchaPrivate key with newlines can break environment variable reading – use base64 encoding.
fix
Export ESLINT_PRIVATE_KEY_BASE64 with base64-encoded key.
affects: >=1.0.0
Errors
Common errors & fixes
Error: ESLINT_APP_ID is not set
Environment variable missing for GitHub App ID.
fix
Set ESLINT_APP_ID to your GitHub App's ID.
Error: ESLINT_PRIVATE_KEY is not set
Private key environment variable missing.
fix
Set ESLINT_PRIVATE_KEY with the contents of your GitHub App's private key.
Error: Failed to create check run
GitHub App permissions or authentication issue.
fix
Ensure App has Checks: Write permission and private key is correct.
Upgrade
Version history
1.1.4latest on npm
Audit
Dependencies
eslintoptionalPeer dependency; formatter is used as an ESLint plugin
Agent activity
2 hits · last 30 days
node
2
Resources
eslint-formatter-github — npm install eslint-formatter-github · libregistry